]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/my-lily-lexer.cc
* lily/my-lily-lexer.cc (My_lily_lexer): don't crash
[lilypond.git] / lily / my-lily-lexer.cc
index 8513720acb50223073064d5c022fb9d244c2f0d0..c69f23c5fac0cb782f2a8f7261849747969cecc5 100644 (file)
 
 
 static Keyword_ent the_key_tab[]={
+  {"accacciatura", ACCACCIATURA},
+  {"accepts", ACCEPTS},
+  {"addlyrics", ADDLYRICS},
   {"alias", ALIAS},
+  {"alternative", ALTERNATIVE},
   {"apply", APPLY},
   {"applycontext", APPLYCONTEXT},
   {"applyoutput", APPLYOUTPUT},
+  {"appoggiatura", APPOGGIATURA},
   {"autochange", AUTOCHANGE},
-  {"simultaneous", SIMULTANEOUS},
-  {"sequential", SEQUENTIAL},
-  {"accepts", ACCEPTS},
-  {"alternative", ALTERNATIVE},
   {"bar", BAR},
   {"breathe", BREATHE},
   {"chordmodifiers", CHORDMODIFIERS},
@@ -47,38 +48,41 @@ static Keyword_ent the_key_tab[]={
   {"denies", DENIES},
   {"description", DESCRIPTION},
   {"duration", DURATION},
-  {"grobdescriptions", GROBDESCRIPTIONS},
   {"figures",FIGURES},
   {"grace", GRACE},
+  {"grobdescriptions", GROBDESCRIPTIONS},
   {"header", HEADER},
-  {"lyrics", LYRICS},
   {"key", KEY},
+  {"lyrics", LYRICS},
   {"mark", MARK},
   {"markup", MARKUP},
-  {"once", ONCE},
-  {"pitch", PITCH},
-  {"time", TIME_T},
-  {"times", TIMES},
   {"midi", MIDI},
   {"name", NAME},
-  {"pitchnames", PITCHNAMES},
+  {"new", NEWCONTEXT},
   {"notes", NOTES},
+  {"octave", OCTAVE},
+  {"once", ONCE},
   {"outputproperty", OUTPUTPROPERTY},
   {"override", OVERRIDE},
-  {"set", SET},
-  {"rest", REST},
-  {"revert", REVERT},
-  {"partial", PARTIAL},
   {"paper", PAPER},
+  {"partcombine", PARTCOMBINE},
+  {"partial", PARTIAL},
+  {"pitch", PITCH},
+  {"pitchnames", PITCHNAMES},
   {"property", PROPERTY},
   {"relative", RELATIVE},
   {"remove", REMOVE},
   {"repeat", REPEAT},
-  {"addlyrics", ADDLYRICS},
-  {"partcombine", PARTCOMBINE},
+  {"rest", REST},
+  {"revert", REVERT},
   {"score", SCORE},
+  {"sequential", SEQUENTIAL},
+  {"set", SET},
+  {"simultaneous", SIMULTANEOUS},
   {"skip", SKIP},
   {"tempo", TEMPO},
+  {"time", TIME_T},
+  {"times", TIMES},
   {"translator", TRANSLATOR},
   {"transpose", TRANSPOSE},
   {"type", TYPE},
@@ -89,7 +93,13 @@ static Keyword_ent the_key_tab[]={
 
 My_lily_lexer::My_lily_lexer ()
 {
+  //  yy_flex_debug = 1;
+  
   keytable_ = new Keyword_table (the_key_tab);
+
+  chordmodifier_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
+  pitchname_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
+  
   scopes_ = SCM_EOL;
   
   add_scope(ly_make_anonymous_module());
@@ -155,6 +165,10 @@ My_lily_lexer::start_main_input ()
 {  
   new_input (main_input_string_, &global_input_file->sources_);
   allow_includes_b_ = allow_includes_b_ &&  ! (safe_global_b);
+
+  scm_module_define (gh_car (scopes_),
+                    ly_symbol2scm ("input-file-name"),
+                    scm_makfrom0str (main_input_string_.to_str0()));
 }
 
 void