Mercurial > hg > octave-lyh
comparison src/help.cc @ 9064:7c02ec148a3c
Check grammar on all .cc files
Same check as previously done on .m files
Attempt to enforce some conformity in documentation text for rules
such as two spaces after a period, commas around latin abbreviations, etc.
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Sat, 28 Mar 2009 13:57:22 -0700 |
parents | eb63fbe60fab |
children | c0cef1436788 |
comparison
equal
deleted
inserted
replaced
9063:a6cf0ad87eee | 9064:7c02ec148a3c |
---|---|
243 @end deffn"), | 243 @end deffn"), |
244 | 244 |
245 pair_type ("case", | 245 pair_type ("case", |
246 "-*- texinfo -*-\n\ | 246 "-*- texinfo -*-\n\ |
247 @deffn Keyword case @{@var{value}@}\n\ | 247 @deffn Keyword case @{@var{value}@}\n\ |
248 A case statement in an switch. Octave cases are exclusive and do not\n\ | 248 A case statement in an switch. Octave cases are exclusive and do not\n\ |
249 fall-through as do C-language cases. A switch statement must have at least\n\ | 249 fall-through as do C-language cases. A switch statement must have at least\n\ |
250 one case. See @code{switch} for an example.\n\ | 250 one case. See @code{switch} for an example.\n\ |
251 @seealso{switch}\n\ | 251 @seealso{switch}\n\ |
252 @end deffn"), | 252 @end deffn"), |
253 | 253 |
254 pair_type ("catch", | 254 pair_type ("catch", |
266 @end deffn"), | 266 @end deffn"), |
267 | 267 |
268 pair_type ("do", | 268 pair_type ("do", |
269 "-*- texinfo -*-\n\ | 269 "-*- texinfo -*-\n\ |
270 @deffn Keyword do\n\ | 270 @deffn Keyword do\n\ |
271 Begin a do-until loop. This differs from a do-while loop in that the\n\ | 271 Begin a do-until loop. This differs from a do-while loop in that the\n\ |
272 body of the loop is executed at least once.\n\ | 272 body of the loop is executed at least once.\n\ |
273 @seealso{while}\n\ | 273 @seealso{while}\n\ |
274 @end deffn"), | 274 @end deffn"), |
275 | 275 |
276 pair_type ("else", | 276 pair_type ("else", |
346 pair_type ("for", | 346 pair_type ("for", |
347 "-*- texinfo -*-\n\ | 347 "-*- texinfo -*-\n\ |
348 @deffn Keyword for @var{i} = @var{range}\n\ | 348 @deffn Keyword for @var{i} = @var{range}\n\ |
349 Begin a for loop.\n\ | 349 Begin a for loop.\n\ |
350 @example\n\ | 350 @example\n\ |
351 @group\n\ | |
351 for i = 1:10\n\ | 352 for i = 1:10\n\ |
352 i\n\ | 353 i\n\ |
353 endfor\n\ | 354 endfor\n\ |
355 @end group\n\ | |
354 @end example\n\ | 356 @end example\n\ |
355 @seealso{do, while}\n\ | 357 @seealso{do, while}\n\ |
356 @end deffn"), | 358 @end deffn"), |
357 | 359 |
358 pair_type ("function", | 360 pair_type ("function", |
359 "-*- texinfo -*-\n\ | 361 "-*- texinfo -*-\n\ |
360 @deffn Keyword function @var{outputs} = function (@var{input}, ...)\n\ | 362 @deffn Keyword function @var{outputs} = function (@var{input}, @dots{})\n\ |
361 @deffnx Keyword function {} function (@var{input}, ...)\n\ | 363 @deffnx Keyword function {} function (@var{input}, @dots{})\n\ |
362 @deffnx Keyword function @var{outputs} = function\n\ | 364 @deffnx Keyword function @var{outputs} = function\n\ |
363 Begin a function body with @var{outputs} as results and @var{inputs} as\n\ | 365 Begin a function body with @var{outputs} as results and @var{inputs} as\n\ |
364 parameters.\n\ | 366 parameters.\n\ |
365 @seealso{return}\n\ | 367 @seealso{return}\n\ |
366 @end deffn"), | 368 @end deffn"), |
368 pair_type ("global", | 370 pair_type ("global", |
369 "-*- texinfo -*-\n\ | 371 "-*- texinfo -*-\n\ |
370 @deffn Keyword global\n\ | 372 @deffn Keyword global\n\ |
371 Declare variables to have global scope.\n\ | 373 Declare variables to have global scope.\n\ |
372 @example\n\ | 374 @example\n\ |
375 @group\n\ | |
373 global @var{x};\n\ | 376 global @var{x};\n\ |
374 if isempty (@var{x})\n\ | 377 if isempty (@var{x})\n\ |
375 x = 1;\n\ | 378 x = 1;\n\ |
376 endif\n\ | 379 endif\n\ |
380 @end group\n\ | |
377 @end example\n\ | 381 @end example\n\ |
378 @seealso{persistent}\n\ | 382 @seealso{persistent}\n\ |
379 @end deffn"), | 383 @end deffn"), |
380 | 384 |
381 pair_type ("if", | 385 pair_type ("if", |
384 @deffnx Keyword if (@var{cond}) @dots{} else @dots{} endif\n\ | 388 @deffnx Keyword if (@var{cond}) @dots{} else @dots{} endif\n\ |
385 @deffnx Keyword if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\ | 389 @deffnx Keyword if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\ |
386 @deffnx Keyword if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\ | 390 @deffnx Keyword if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\ |
387 Begin an if block.\n\ | 391 Begin an if block.\n\ |
388 @example\n\ | 392 @example\n\ |
393 @group\n\ | |
389 x = 1;\n\ | 394 x = 1;\n\ |
390 if (x == 1)\n\ | 395 if (x == 1)\n\ |
391 disp (\"one\");\n\ | 396 disp (\"one\");\n\ |
392 elseif (x == 2)\n\ | 397 elseif (x == 2)\n\ |
393 disp (\"two\");\n\ | 398 disp (\"two\");\n\ |
394 else\n\ | 399 else\n\ |
395 disp (\"not one or two\");\n\ | 400 disp (\"not one or two\");\n\ |
396 endif\n\ | 401 endif\n\ |
402 @end group\n\ | |
397 @end example\n\ | 403 @end example\n\ |
398 @seealso{switch}\n\ | 404 @seealso{switch}\n\ |
399 @end deffn"), | 405 @end deffn"), |
400 | 406 |
401 pair_type ("otherwise", | 407 pair_type ("otherwise", |
440 pair_type ("switch", | 446 pair_type ("switch", |
441 "-*- texinfo -*-\n\ | 447 "-*- texinfo -*-\n\ |
442 @deffn Keyword switch @var{statement}\n\ | 448 @deffn Keyword switch @var{statement}\n\ |
443 Begin a switch block.\n\ | 449 Begin a switch block.\n\ |
444 @example\n\ | 450 @example\n\ |
451 @group\n\ | |
445 yesno = \"yes\"\n\ | 452 yesno = \"yes\"\n\ |
446 \n\ | 453 \n\ |
447 switch yesno\n\ | 454 switch yesno\n\ |
448 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\ | 455 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\ |
449 value = 1;\n\ | 456 value = 1;\n\ |
450 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\ | 457 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\ |
451 value = 0;\n\ | 458 value = 0;\n\ |
452 otherwise\n\ | 459 otherwise\n\ |
453 error (\"invalid value\");\n\ | 460 error (\"invalid value\");\n\ |
454 endswitch\n\ | 461 endswitch\n\ |
462 @end group\n\ | |
455 @end example\n\ | 463 @end example\n\ |
456 @seealso{if, case, otherwise}\n\ | 464 @seealso{if, case, otherwise}\n\ |
457 @end deffn"), | 465 @end deffn"), |
458 | 466 |
459 pair_type ("try", | 467 pair_type ("try", |
730 DEFUN (get_help_text, args, , "-*- texinfo -*-\n\ | 738 DEFUN (get_help_text, args, , "-*- texinfo -*-\n\ |
731 @deftypefn {Loadable Function} {[@var{text}, @var{format}] =} get_help_text (@var{name})\n\ | 739 @deftypefn {Loadable Function} {[@var{text}, @var{format}] =} get_help_text (@var{name})\n\ |
732 Returns the help text of a given function.\n\ | 740 Returns the help text of a given function.\n\ |
733 \n\ | 741 \n\ |
734 This function returns the raw help text @var{text} and an indication of\n\ | 742 This function returns the raw help text @var{text} and an indication of\n\ |
735 its format for the function @var{name}. The format indication @var{format}\n\ | 743 its format for the function @var{name}. The format indication @var{format}\n\ |
736 is a string that can be either @t{\"texinfo\"}, @t{\"html\"}, or\n\ | 744 is a string that can be either @t{\"texinfo\"}, @t{\"html\"}, or\n\ |
737 @t{\"plain text\"}.\n\ | 745 @t{\"plain text\"}.\n\ |
738 \n\ | 746 \n\ |
739 To convert the help text to other formats, use the @code{makeinfo} function.\n\ | 747 To convert the help text to other formats, use the @code{makeinfo} function.\n\ |
740 \n\ | 748 \n\ |