bool is_chord_state () const;
bool is_lyric_state () const;
bool is_figure_state () const;
+ bool is_clean () const;
};
#endif /* MY_LILY_LEXER_HH */
Lily_parser *parser = unsmob_lily_parser (parser_smob);
LY_ASSERT_TYPE (scm_is_string, ly_code, 2);
- parser->parse_string (ly_scm2string (ly_code));
+ if (!parser->lexer_->is_clean ())
+ parser->parser_error (_ ("ly:parser-parse-string is only valid with a new parser."
+ " Use ly:parser-include-string instead."));
+ else
+ parser->parse_string (ly_scm2string (ly_code));
return SCM_UNSPECIFIED;
}