source file of the LilyPond music typesetter
- (c) 1996--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
lookup_markup_command (String s);
bool
-valid_version_b (String s);
+is_valid_version (String s);
s = s.left_string (s.index_last ('\"'));
yy_pop_state();
- if (!valid_version_b (s))
+ if (!is_valid_version (s))
return INVALID;
}
<renameinput>\"[^"]*\" { /* got the version number */
yy_pop_state();
this->here_input().source_file_->name_ = s;
- progress_indication (_f("\nRenamed input to `%s'", s.to_str0()));
+ progress_indication ("\n");
+ progress_indication (_f ("input renamed to: `%s'", s.to_str0 ()));
+ progress_indication ("\n");
scm_module_define (gh_car (scopes_),
ly_symbol2scm ("input-file-name"),
scm_makfrom0str (s.to_str0()));
String s (YYText ()+1);
s = s.left_string (s.index_last ('"'));
- new_input (s, &global_input_file->sources_ );
+ new_input (s, &global_input_file->sources_);
yy_pop_state ();
}
<incl>\\{BLACK}*;?{WHITE} { /* got the include identifier */
<chords,notes,figures>R {
return MULTI_MEASURE_REST;
}
-<INITIAL,chords,lyrics,notes,figures>\\\${BLACK}*{WHITE} {
- String s=YYText () + 2;
- s=s.left_string (s.length () - 1);
- return scan_escaped_word (s);
-}
-<INITIAL,chords,lyrics,notes,figures>\${BLACK}*{WHITE} {
- String s=YYText () + 1;
- s=s.left_string (s.length () - 1);
- return scan_bare_word (s);
-}
-<INITIAL,chords,lyrics,notes,figures>\\\${BLACK}* { // backup rule
- error (_("white expected"));
- exit (1);
-}
-<INITIAL,chords,lyrics,notes,figures>\${BLACK}* { // backup rule
- error (_("white expected"));
- exit (1);
-}
-
<INITIAL,markup,chords,lyrics,notes,figures># { //embedded scm
//char const* s = YYText () + 1;
char const* s = here_str0 ();
yy_push_state (figures);
}
void
-My_lily_lexer::push_chord_state ()
+My_lily_lexer::push_chord_state (SCM tab)
{
+ pitchname_tab_stack_ = gh_cons (tab, pitchname_tab_stack_);
yy_push_state (chords);
}
void
My_lily_lexer::pop_state ()
{
- if (YYSTATE == notes)
+ if (YYSTATE == notes || YYSTATE == chords)
pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_);
yy_pop_state ();
}
int
-My_lily_lexer::identifier_type(SCM sid)
+My_lily_lexer::identifier_type (SCM sid)
{
- int k = try_special_identifiers(&yylval.scm , sid);
+ int k = try_special_identifiers (&yylval.scm , sid);
return k >= 0 ? k : SCM_IDENTIFIER;
}
{
SCM sym = ly_symbol2scm (str.to_str0 ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
- SCM handle = scm_hashq_get_handle (gh_car (pitchname_tab_stack_), sym);
+ SCM handle = SCM_BOOL_F;
+ if (gh_pair_p (pitchname_tab_stack_))
+ handle = scm_hashq_get_handle (gh_car (pitchname_tab_stack_), sym);
if (gh_pair_p (handle)) {
yylval.scm = ly_cdr (handle);
}
bool
-My_lily_lexer::note_state_b () const
+My_lily_lexer::is_note_state () const
{
return YY_START == notes;
}
bool
-My_lily_lexer::chord_state_b () const
+My_lily_lexer::is_chord_state () const
{
return YY_START == chords;
}
bool
-My_lily_lexer::lyric_state_b () const
+My_lily_lexer::is_lyric_state () const
{
return YY_START == lyrics;
}
bool
-My_lily_lexer::figure_state_b () const
+My_lily_lexer::is_figure_state () const
{
return YY_START == figures;
}
-/* 1.9.0 == postfix articulations */
-Lilypond_version oldest_version ("1.9.0");
+/* 2.1.2x something -> \property -> \set. */
+Lilypond_version oldest_version ("2.1.25");
bool
-valid_version_b (String s)
+is_valid_version (String s)
{
Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
Lilypond_version ver (s);
/*
- substittute _ adn \,
+ substitute _ and \,
*/
String
lyric_fudge (String s)
SCM
lookup_markup_command (String s)
{
- static SCM proc ;
- if (!proc)
- proc = scm_c_eval_string ("lookup-markup-command");
+ SCM proc = ly_scheme_function ("lookup-markup-command");
return scm_call_1 (proc, scm_makfrom0str (s.to_str0 ()));
}