comparison src/lex.ll @ 15466:d174210ce1ec stable

use ' instead of ` in error messages, warnings and most comments * intro.txi, io.txi, munge-texi.cc, octave.texi, cmd-edit.cc, data-conv.cc, file-ops.cc, glob-match.h, kpse.cc, oct-env.cc, oct-locbuf.h, oct-md5.cc, oct-rand.cc, general/interp2.m, doc.m, get_first_help_sentence.m, help.m, print_usage.m, __additional_help_message__.m, type.m, unimplemented.m, which.m, cast.m, dir.m, license.m, mkoctfile.m, recycle.m, tempdir.m, optimset.m, pkg/pkg.m, closereq.m, colstyle.m, __fltk_print__.m, __gnuplot_print__.m, __go_draw_figure__.m, __pie__.m, __pltopt__.m, __print_parse_opts__.m, uigetdir.m, uigetfile.m, uiputfile.m, stft.m, mean.m, anova.m, cor_test.m, t_test_regression.m, __magick_read__.cc, dlmread.cc, schur.cc, data.cc, debug.cc, defun-dld.h, defun.cc, defun.h, dynamic-ld.cc, error.cc, error.h, gl-render.cc, graphics.cc, gripes.cc, input.cc, lex.ll, load-path.cc, load-save.cc, ls-hdf5.cc, ls-mat-ascii.cc, ls-mat4.cc, ls-mat5.cc, ls-oct-ascii.cc, ls-oct-binary.cc, oct-hist.cc, oct-parse.yy, oct-stream.cc, oct-stream.h, octave.cc, ov-base-diag.cc, ov-base.cc, ov-class.cc, ov-colon.h, ov-struct.cc, ov-typeinfo.cc, ov.cc, pager.cc, pr-output.cc, pt-binop.cc, pt-eval.cc, pt-id.cc, pt-idx.cc, pt-misc.cc, pt-unop.cc, symtab.cc, symtab.h, toplev.cc, txt-eng-ft.cc, utils.cc, variables.cc, test_eval-catch.m, test_try.m: Use ' instead of ` in error messages, warnings, and most comments.
author John W. Eaton <jwe@octave.org>
date Mon, 01 Oct 2012 17:18:49 -0400
parents f4b5a2f899d3
children
comparison
equal deleted inserted replaced
15437:c9954a15bc03 15466:d174210ce1ec
105 if ((result = octave_read (buf, max_size)) < 0) \ 105 if ((result = octave_read (buf, max_size)) < 0) \
106 YY_FATAL_ERROR ("octave_read () in flex scanner failed"); 106 YY_FATAL_ERROR ("octave_read () in flex scanner failed");
107 107
108 // Try to avoid crashing out completely on fatal scanner errors. 108 // Try to avoid crashing out completely on fatal scanner errors.
109 // The call to yy_fatal_error should never happen, but it avoids a 109 // The call to yy_fatal_error should never happen, but it avoids a
110 // `static function defined but not used' warning from gcc. 110 // 'static function defined but not used' warning from gcc.
111 111
112 #ifdef YY_FATAL_ERROR 112 #ifdef YY_FATAL_ERROR
113 #undef YY_FATAL_ERROR 113 #undef YY_FATAL_ERROR
114 #endif 114 #endif
115 #define YY_FATAL_ERROR(msg) \ 115 #define YY_FATAL_ERROR(msg) \
427 TOK_PUSH_AND_RETURN (tok, SQ_STRING); 427 TOK_PUSH_AND_RETURN (tok, SQ_STRING);
428 } 428 }
429 429
430 %{ 430 %{
431 // For this and the next two rules, we're looking at ']', and we 431 // For this and the next two rules, we're looking at ']', and we
432 // need to know if the next token is `=' or `=='. 432 // need to know if the next token is '=' or '=='.
433 // 433 //
434 // It would have been so much easier if the delimiters were simply 434 // It would have been so much easier if the delimiters were simply
435 // different for the expression on the left hand side of the equals 435 // different for the expression on the left hand side of the equals
436 // operator. 436 // operator.
437 // 437 //
669 handle_number (); 669 handle_number ();
670 COUNT_TOK_AND_RETURN (IMAG_NUM); 670 COUNT_TOK_AND_RETURN (IMAG_NUM);
671 } 671 }
672 672
673 %{ 673 %{
674 // Real numbers. Don't grab the `.' part of a dot operator as part of 674 // Real numbers. Don't grab the '.' part of a dot operator as part of
675 // the constant. 675 // the constant.
676 %} 676 %}
677 677
678 {D}+/\.[\*/\\^\'] | 678 {D}+/\.[\*/\\^\'] |
679 {NUMBER} { 679 {NUMBER} {
718 { 718 {
719 warning ("block comment open at end of input"); 719 warning ("block comment open at end of input");
720 720
721 if ((reading_fcn_file || reading_script_file || reading_classdef_file) 721 if ((reading_fcn_file || reading_script_file || reading_classdef_file)
722 && ! curr_fcn_file_name.empty ()) 722 && ! curr_fcn_file_name.empty ())
723 warning ("near line %d of file `%s.m'", 723 warning ("near line %d of file '%s.m'",
724 input_line_number, curr_fcn_file_name.c_str ()); 724 input_line_number, curr_fcn_file_name.c_str ());
725 } 725 }
726 726
727 TOK_RETURN (END_OF_INPUT); 727 TOK_RETURN (END_OF_INPUT);
728 } 728 }
1066 1066
1067 if (c != EOF) 1067 if (c != EOF)
1068 { 1068 {
1069 current_input_column++; 1069 current_input_column++;
1070 1070
1071 error ("invalid character `%s' (ASCII %d) near line %d, column %d", 1071 error ("invalid character '%s' (ASCII %d) near line %d, column %d",
1072 undo_string_escape (static_cast<char> (c)), c, 1072 undo_string_escape (static_cast<char> (c)), c,
1073 input_line_number, current_input_column); 1073 input_line_number, current_input_column);
1074 1074
1075 return LEXICAL_ERROR; 1075 return LEXICAL_ERROR;
1076 } 1076 }
2526 xunput (s[len], yytext); 2526 xunput (s[len], yytext);
2527 2527
2528 return false; 2528 return false;
2529 } 2529 }
2530 2530
2531 // We have seen a `.' and need to see if it is the start of a 2531 // We have seen a '.' and need to see if it is the start of a
2532 // continuation. If so, this eats it, up to and including the new 2532 // continuation. If so, this eats it, up to and including the new
2533 // line character. 2533 // line character.
2534 2534
2535 static bool 2535 static bool
2536 have_ellipsis_continuation (bool trailing_comments_ok) 2536 have_ellipsis_continuation (bool trailing_comments_ok)
3317 // Kluge alert. 3317 // Kluge alert.
3318 // 3318 //
3319 // If we are looking at a text style function, set up to gobble its 3319 // If we are looking at a text style function, set up to gobble its
3320 // arguments. 3320 // arguments.
3321 // 3321 //
3322 // If the following token is `=', or if we are parsing a function 3322 // If the following token is '=', or if we are parsing a function
3323 // return list or function parameter list, or if we are looking at 3323 // return list or function parameter list, or if we are looking at
3324 // something like [ab,cd] = foo (), force the symbol to be inserted 3324 // something like [ab,cd] = foo (), force the symbol to be inserted
3325 // as a variable in the current symbol table. 3325 // as a variable in the current symbol table.
3326 3326
3327 if (! is_variable (tok)) 3327 if (! is_variable (tok))
3516 { 3516 {
3517 std::string nm = curr_fcn_file_full_name; 3517 std::string nm = curr_fcn_file_full_name;
3518 3518
3519 if (nm.empty ()) 3519 if (nm.empty ())
3520 warning_with_id ("Octave:separator-insert", 3520 warning_with_id ("Octave:separator-insert",
3521 "potential auto-insertion of `%c' near line %d", 3521 "potential auto-insertion of '%c' near line %d",
3522 sep, input_line_number); 3522 sep, input_line_number);
3523 else 3523 else
3524 warning_with_id ("Octave:separator-insert", 3524 warning_with_id ("Octave:separator-insert",
3525 "potential auto-insertion of `%c' near line %d of file %s", 3525 "potential auto-insertion of '%c' near line %d of file %s",
3526 sep, input_line_number, nm.c_str ()); 3526 sep, input_line_number, nm.c_str ());
3527 } 3527 }
3528 3528
3529 static void 3529 static void
3530 gripe_single_quote_string (void) 3530 gripe_single_quote_string (void)