%x markup
%x notes
%x quote
+%x sourcefileline
%x sourcefilename
%x version
<INITIAL,chords,lyrics,notes,figures>\\sourcefilename{WHITE}* {
yy_push_state (sourcefilename);
}
+<INITIAL,chords,lyrics,notes,figures>\\sourcefileline{WHITE}* {
+ yy_push_state (sourcefileline);
+}
<version>\"[^"]*\" { /* got the version number */
string s (YYText () + 1);
s = s.substr (0, s.rfind ('\"'));
scm_makfrom0str (s.c_str ()));
}
+
+<sourcefileline>{INT} {
+ int i;
+ sscanf (YYText (), "%d", &i);
+
+// this->set_debug (1);
+ yy_pop_state ();
+ this->here_input ().get_source_file ()->set_line (here_input ().start (), i);
+}
+
<version>. {
LexerError (_ ("quoted string expected after \\version").c_str ());
yy_pop_state ();
LexerError (_ ("quoted string expected after \\sourcefilename").c_str ());
yy_pop_state ();
}
+<sourcefileline>. {
+ LexerError (_ ("integer expected after \\sourcefileline").c_str ());
+ yy_pop_state ();
+}
<longcomment>{
[^\%]* {
}
}
yylval.scm = sval;
- return SCM_T;
+ return SCM_TOKEN;
}
<INITIAL,notes,lyrics>{
\<\< {
}
}
-<<EOF>> {
+<*><<EOF>> {
if (is_main_input_)
{
is_main_input_ = false;
};
for (int i = 0; sigs[i].symbol; i++)
- scm_hashq_set_x (signature_hash_table, scm_gc_protect_object (ly_symbol2scm (sigs[i].symbol)),
+ scm_hashq_set_x (signature_hash_table, ly_symbol2scm (sigs[i].symbol),
scm_from_int (sigs[i].token_type));
}