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);
{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;
}
+ \\\" {
+ 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 ();
}
{WORD} {
return scan_bare_word (YYText_utf8 ());
}
+ \\\" {
+ start_command_quote ();
+ }
{COMMAND}/[-_] | // backup rule
{COMMAND} {
return scan_escaped_word (YYText_utf8 () + 1);