/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
LilyPond is free software: you can redistribute it and/or modify
} else if (Output_def * od = Output_def::unsmob ($1)) {
SCM id = SCM_EOL;
- if (od->c_variable ("is-paper") == SCM_BOOL_T)
+ if (to_boolean (od->c_variable ("is-paper")))
id = ly_symbol2scm ("$defaultpaper");
- else if (od->c_variable ("is-midi") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-midi")))
id = ly_symbol2scm ("$defaultmidi");
- else if (od->c_variable ("is-layout") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-layout")))
id = ly_symbol2scm ("$defaultlayout");
parser->lexer_->set_identifier (id, $1);
SCM id = SCM_EOL;
Output_def * od = Output_def::unsmob ($1);
- if (od->c_variable ("is-paper") == SCM_BOOL_T)
+ if (to_boolean (od->c_variable ("is-paper")))
id = ly_symbol2scm ("$defaultpaper");
- else if (od->c_variable ("is-midi") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-midi")))
id = ly_symbol2scm ("$defaultmidi");
- else if (od->c_variable ("is-layout") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-layout")))
id = ly_symbol2scm ("$defaultlayout");
parser->lexer_->set_identifier (id, $1);
} else if (Output_def *od = Output_def::unsmob ($2)) {
SCM id = SCM_EOL;
- if (od->c_variable ("is-paper") == SCM_BOOL_T)
+ if (to_boolean (od->c_variable ("is-paper")))
id = ly_symbol2scm ("$defaultpaper");
- else if (od->c_variable ("is-midi") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-midi")))
id = ly_symbol2scm ("$defaultmidi");
- else if (od->c_variable ("is-layout") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-layout")))
id = ly_symbol2scm ("$defaultlayout");
parser->lexer_->set_identifier (id, $2);
} else if (Output_def *od = Output_def::unsmob ($2)) {
SCM id = SCM_EOL;
- if (od->c_variable ("is-paper") == SCM_BOOL_T)
+ if (to_boolean (od->c_variable ("is-paper")))
id = ly_symbol2scm ("$defaultpaper");
- else if (od->c_variable ("is-midi") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-midi")))
id = ly_symbol2scm ("$defaultmidi");
- else if (od->c_variable ("is-layout") == SCM_BOOL_T)
+ else if (to_boolean (od->c_variable ("is-layout")))
id = ly_symbol2scm ("$defaultlayout");
parser->lexer_->set_identifier (id, $2);
{
Output_def *od = Output_def::unsmob ($2);
if (od) {
- if (od->lookup_variable (ly_symbol2scm ("is-paper")) == SCM_BOOL_T)
+ if (to_boolean (od->lookup_variable (ly_symbol2scm ("is-paper"))))
{
parser->parser_error (@2, _("\\paper cannot be used in \\score, use \\layout instead"));
od = 0;
output_def {
Output_def *od = Output_def::unsmob ($1);
- if (od->lookup_variable (ly_symbol2scm ("is-paper")) != SCM_BOOL_T)
+ if (!to_boolean (od->lookup_variable (ly_symbol2scm ("is-paper"))))
{
parser->parser_error (@1, _ ("need \\paper for paper block"));
$$ = get_paper (parser)->unprotect ();
mode_changed_music:
mode_changing_head grouped_music_list {
- if ($1 == ly_symbol2scm ("chords"))
+ if (scm_is_eq ($1, ly_symbol2scm ("chords")))
{
$$ = MAKE_SYNTAX ("unrelativable-music", @$, $2);
}
if (ctxmod)
mods = ctxmod->get_mods ();
$$ = MAKE_SYNTAX ("context-specification", @$, $1, SCM_EOL, mods, SCM_BOOL_T, $3);
- if ($1 == ly_symbol2scm ("ChordNames"))
+ if (scm_is_eq ($1, ly_symbol2scm ("ChordNames")))
{
$$ = MAKE_SYNTAX ("unrelativable-music", @$, $$);
}
script_abbreviation:
'^' {
- $$ = scm_from_locale_string ("Hat");
+ $$ = scm_from_ascii_string ("Hat");
}
| '+' {
- $$ = scm_from_locale_string ("Plus");
+ $$ = scm_from_ascii_string ("Plus");
}
| '-' {
- $$ = scm_from_locale_string ("Dash");
+ $$ = scm_from_ascii_string ("Dash");
}
| '!' {
- $$ = scm_from_locale_string ("Bang");
+ $$ = scm_from_ascii_string ("Bang");
}
| ANGLE_CLOSE {
- $$ = scm_from_locale_string ("Larger");
+ $$ = scm_from_ascii_string ("Larger");
}
| '.' {
- $$ = scm_from_locale_string ("Dot");
+ $$ = scm_from_ascii_string ("Dot");
}
| '_' {
- $$ = scm_from_locale_string ("Underscore");
+ $$ = scm_from_ascii_string ("Underscore");
}
;
SCM
get_next_unique_context_id ()
{
- return scm_from_locale_string ("$uniqueContextId");
+ return scm_from_ascii_string ("$uniqueContextId");
}
static int new_context_count;
char s[128];
snprintf (s, sizeof (s)-1, "uniqueContext%d", new_context_count++);
- return scm_from_locale_string (s);
+ return scm_from_ascii_string (s);
}
// check_scheme_arg checks one argument with a given predicate for use