2006-02-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/parser.yy (output_def_head_with_mode_switch): new
+ production. Result: dashes and underscores may be used in the
+ \paper block.
+
+ * lily/lexer.ll: add DASHED_WORD. Accept in INITIAL mode.
+
* python/convertrules.py (conv): oops. One slash too much.
2006-02-02 Jan Nieuwenhuizen <janneke@gnu.org>
NATIONAL [\001-\006\021-\027\031\036\200-\377]
TEX {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
WORD {A}{AN}*
+DASHED_WORD {A}({AN}|-)*
+DASHED_KEY_WORD \\{DASHED_WORD}
ALPHAWORD {A}+
DIGIT {N}
UNSIGNED {N}+
LexerError (_ ("quoted string expected after \\version").c_str ());
yy_pop_state ();
}
-<sourcefilename>>. {
+<sourcefilename>. {
LexerError (_ ("quoted string expected after \\sourcefilename").c_str ());
yy_pop_state ();
}
yyterminate ();
}
+<INITIAL>{
+ {DASHED_WORD} {
+ return scan_bare_word (YYText ());
+ }
+ {DASHED_KEY_WORD} {
+ return scan_escaped_word (YYText () + 1);
+ }
+}
{WORD} {
return scan_bare_word (YYText ());
%type <outputdef> output_def_body
%type <outputdef> output_def_head
+%type <outputdef> output_def_head_with_mode_switch
%type <outputdef> output_def
%type <outputdef> paper_block
assignment_id '=' identifier_init {
if (! is_regular_identifier ($1))
{
+#if 0
+ /* no longer valid with dashes in \paper{} block. */
@1.warning (_ ("identifier should have alphabetic characters only"));
+#endif
}
+
THIS->lexer_->set_identifier ($1, $3);
/*
}
;
+output_def_head_with_mode_switch:
+ output_def_head {
+ THIS->lexer_->push_initial_state ();
+ $$ = $1;
+ }
+ ;
output_def_body:
- output_def_head '{' {
+ output_def_head_with_mode_switch '{' {
$$ = $1;
$$->input_origin_.set_spot (@$);
- THIS->lexer_->push_initial_state ();
}
- | output_def_head '{' OUTPUT_DEF_IDENTIFIER {
+ | output_def_head_with_mode_switch '{' OUTPUT_DEF_IDENTIFIER {
$1->unprotect ();
Output_def *o = unsmob_output_def ($3);
o->input_origin_.set_spot (@$);
$$ = o;
THIS->lexer_->remove_scope ();
THIS->lexer_->add_scope (o->scope_);
- THIS->lexer_->push_initial_state ();
}
| output_def_body assignment {