X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flexer.ll;h=0914fee3290361f3fb188d41e1f79c4ba5194da4;hb=4300e287a18cbc4569c79f8e8445609dc7d4546a;hp=081dd002215078bc6996579bf418db57d648b2c8;hpb=15c43df3abc82ef71c674d7a7e4e4b6951b38187;p=lilypond.git diff --git a/lily/lexer.ll b/lily/lexer.ll index 081dd00221..0914fee329 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -4,7 +4,7 @@ source file of the LilyPond music typesetter - (c) 1996--2004 Han-Wen Nienhuys + (c) 1996--2005 Han-Wen Nienhuys Jan Nieuwenhuizen */ @@ -76,6 +76,9 @@ bool is_valid_version (String s); #define yylval \ (*(YYSTYPE*)lexval) +#define yylloc \ + (*(YYLTYPE*)lexloc) + #define YY_USER_ACTION add_lexed_char (YYLeng ()); /* @@ -101,7 +104,6 @@ SCM (* scm_parse_error_handler) (void *); %option warn %x chords -%x encoding %x figures %x incl %x lyrics @@ -164,21 +166,12 @@ HYPHEN -- } } -\\encoding{WHITE}* { - yy_push_state (encoding); -} \\version{WHITE}* { yy_push_state (version); } \\renameinput{WHITE}* { yy_push_state (renameinput); } -\"[^"]*\" { - String s (YYText () + 1); - s = s.left_string (s.index_last ('\"')); - set_encoding (s); - yy_pop_state (); -} \"[^"]*\" { /* got the version number */ String s (YYText () + 1); s = s.left_string (s.index_last ('\"')); @@ -204,10 +197,6 @@ HYPHEN -- scm_makfrom0str (s.to_str0 ())); } -. { - LexerError (_ ("No quoted string found after \\encoding").to_str0 ()); - yy_pop_state (); -} . { LexerError (_ ("No quoted string found after \\version").to_str0 ()); yy_pop_state (); @@ -227,7 +216,7 @@ HYPHEN -- } <> { LexerError (_ ("EOF found inside a comment").to_str0 ()); - main_input_b_ = false; + is_main_input_ = false; if (! close_input ()) yyterminate (); // can't move this, since it actually rets a YY_NULL } @@ -235,10 +224,10 @@ HYPHEN -- \\maininput { - if (!main_input_b_) + if (!is_main_input_) { start_main_input (); - main_input_b_ = true; + is_main_input_ = true; } else error (_ ("\\maininput not allowed outside init files")); @@ -286,11 +275,11 @@ HYPHEN -- return MULTI_MEASURE_REST; } # { //embedded scm - //char const* s = YYText () + 1; - char const* s = here_str0 (); int n = 0; - SCM sval = ly_parse_scm (s, &n, here_input (), - safe_global_b && main_input_b_); + Input hi = here_input(); + hi.step_forward (); + SCM sval = ly_parse_scm (hi.start_, &n, hi, + be_safe_global && is_main_input_); if (sval == SCM_UNDEFINED) { @@ -547,9 +536,9 @@ HYPHEN -- } <> { - if (main_input_b_) + if (is_main_input_) { - main_input_b_ = false; + is_main_input_ = false; if (!close_input ()) /* Returns YY_NULL */ yyterminate (); @@ -882,7 +871,7 @@ avoid_silly_flex_induced_gcc_warnings () SCM lookup_markup_command (String s) { - SCM proc = ly_scheme_function ("lookup-markup-command"); + SCM proc = ly_lily_module_constant ("lookup-markup-command"); return scm_call_1 (proc, scm_makfrom0str (s.to_str0 ())); }