yylval = SCM_EOL; \
} while (0)
+/*
+ The inside of \"violin1" is marked by commandquote mode
+*/
+
+#define start_command_quote() do { \
+ yy_push_state (commandquote); \
+ yylval = SCM_EOL; \
+ } while (0)
+
#define yylval (*lexval_)
#define yylloc (*lexloc_)
%x markup
%x notes
%x quote
+%x commandquote
%x sourcefileline
%x sourcefilename
%x version
{WORD} {
return scan_bare_word (YYText_utf8 ());
}
-
+ \\\" {
+ start_command_quote ();
+ }
{COMMAND}/[-_] | // backup rule
{COMMAND} {
return scan_escaped_word (YYText_utf8 () + 1);
}
}
-<quote>{
+<quote,commandquote>{
\\{ESCAPED} {
char c = escaped_char (YYText ()[1]);
yylval = scm_cons (scm_from_locale_stringn (&c, 1),
}
\" {
- yy_pop_state ();
-
/* yylval is union. Must remember STRING before setting SCM*/
yylval = scm_string_concatenate_reverse (yylval,
SCM_UNDEFINED,
SCM_UNDEFINED);
+ if (get_state () == commandquote) {
+ yy_pop_state ();
+ return scan_escaped_word (ly_scm2string (yylval));
+ }
+
+ yy_pop_state ();
+
return STRING;
}
\\ {
yylval = scm_c_read_string (YYText ());
return UNSIGNED;
}
+ \\\" {
+ start_command_quote ();
+ }
{COMMAND}/[-_] | // backup rule
{COMMAND} {
return scan_escaped_word (YYText_utf8 () + 1);
yylval = SCM_UNSPECIFIED;
return YYText ()[0];
}
- [^$#{}\"\\ \t\n\r\f0-9]+ {
+ [^|*.=$#{}\"\\ \t\n\r\f0-9][^$#{}\"\\ \t\n\r\f0-9]* {
/* ugr. This sux. */
string s (YYText_utf8 ());
yylval = SCM_UNSPECIFIED;
{WORD} {
return scan_bare_word (YYText_utf8 ());
}
+ \\\" {
+ start_command_quote ();
+ }
{COMMAND}/[-_] | // backup rule
{COMMAND} {
return scan_escaped_word (YYText_utf8 () + 1);
yylval = SCM_UNSPECIFIED;
return SCORE;
}
+ \\score-lines {
+ yylval = SCM_UNSPECIFIED;
+ return SCORELINES;
+ }
+ \\\" {
+ start_command_quote ();
+ }
{COMMAND}/[-_] | // backup rule
{COMMAND} {
string str (YYText_utf8 () + 1);
yy_pop_state ();
}
-<quote><<EOF>> {
+<quote,commandquote><<EOF>> {
LexerError (_ ("EOF found inside string").c_str ());
yy_pop_state ();
}
{
LexerError (_ ("Unfinished main input").c_str ());
do {
- pop_state ();
+ yy_pop_state ();
} while (YYSTATE != maininput);
}
- pop_state ();
+ extra_tokens_ = SCM_EOL;
+ yy_pop_state ();
}
if (!close_input () || !is_main_input_)
/* Returns YY_NULL */
{WORD} {
return scan_bare_word (YYText_utf8 ());
}
+ \\\" {
+ start_command_quote ();
+ }
{COMMAND}/[-_] | // backup rule
{COMMAND} {
return scan_escaped_word (YYText_utf8 () + 1);
if (YYSTATE == notes || YYSTATE == chords)
pitchname_tab_stack_ = scm_cdr (pitchname_tab_stack_);
- yy_pop_state ();
+ // don't cross the maininput threshold
+ if (YYSTATE != maininput)
+ yy_pop_state ();
if (extra) {
hidden_state_ = YYSTATE;
SCM sid = lookup_identifier (str);
if (Music *m = unsmob_music (sid))
{
- m->set_spot (override_input (last_input_));
+ m->set_spot (override_input (here_input ()));
}
if (sid != SCM_UNDEFINED)
SCM sid = lookup_identifier (str);
if (Music *m = unsmob_music (sid))
{
- m->set_spot (override_input (last_input_));
+ m->set_spot (override_input (here_input ()));
}
if (sid != SCM_UNDEFINED)
cs = SCM_CAR (cs);
}
- if (cs == Pitch_type_p_proc)
- push_extra_token (EXPECT_PITCH);
- else if (cs == Duration_type_p_proc)
- push_extra_token (EXPECT_DURATION);
- else if (ly_is_procedure (cs))
+ if (ly_is_procedure (cs))
push_extra_token (EXPECT_SCM, cs);
else
{
if (Music *m = unsmob_music (v))
{
if (!unsmob_input (m->get_property ("origin")))
- m->set_spot (override_input (last_input_));
+ m->set_spot (override_input (here_input ()));
}
int token;
if (Music *m = unsmob_music (sval))
{
if (!unsmob_input (m->get_property ("origin")))
- m->set_spot (override_input (last_input_));
+ m->set_spot (override_input (here_input ()));
}
return sval;