OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 if (scm_is_string (path)) | 278 if (scm_is_string (path)) |
279 sym = scm_string_to_symbol (path); | 279 sym = scm_string_to_symbol (path); |
280 else if (scm_is_pair (path)) | 280 else if (scm_is_pair (path)) |
281 { | 281 { |
282 sym = scm_car (path); | 282 sym = scm_car (path); |
283 path = scm_cdr (path); | 283 path = scm_cdr (path); |
284 } | 284 } |
285 | 285 |
286 if (scm_is_symbol (sym)) | 286 if (scm_is_symbol (sym)) |
287 { | 287 { |
| 288 string symstr = ly_symbol2string (sym); |
288 if (lookup_keyword (ly_symbol2string (sym)) >= 0) | 289 if (lookup_keyword (ly_symbol2string (sym)) >= 0) |
289 { | 290 { |
290 string symstr = ly_symbol2string (sym); | |
291 warning (_f ("identifier name is a keyword: `%s'", symstr.c_str ())); | 291 warning (_f ("identifier name is a keyword: `%s'", symstr.c_str ())); |
292 } | 292 } |
293 | 293 |
294 SCM mod = scm_car (scopes_); | 294 SCM mod = scm_car (scopes_); |
295 | 295 |
296 if (scm_is_pair (path)) | 296 if (scm_is_pair (path)) |
297 { | 297 { |
298 SCM prev = scm_module_lookup (mod, sym); | 298 SCM prev = scm_module_lookup (mod, sym); |
299 if (prev != SCM_UNDEFINED) | 299 if (prev != SCM_UNDEFINED) |
300 val = nested_property_alist (prev, path, val); | 300 val = nested_property_alist (prev, path, val); |
301 } | 301 } |
| 302 |
| 303 /* Do the equivalent of (define-public( sym val) */ |
302 scm_module_define (mod, sym, val); | 304 scm_module_define (mod, sym, val); |
| 305 scm_c_export (symstr.c_str(), NULL); |
303 } | 306 } |
304 else | 307 else |
305 programming_error ("identifier is not a symbol"); | 308 programming_error ("identifier is not a symbol"); |
306 } | 309 } |
307 | 310 |
308 void | 311 void |
309 Lily_lexer::LexerError (char const *s) | 312 Lily_lexer::LexerError (char const *s) |
310 { | 313 { |
311 if (include_stack_.empty ()) | 314 if (include_stack_.empty ()) |
312 message (_f ("error at EOF: %s", s) + "\n"); | 315 message (_f ("error at EOF: %s", s) + "\n"); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 int | 387 int |
385 Lily_lexer::print_smob (SCM s, SCM port, scm_print_state*) | 388 Lily_lexer::print_smob (SCM s, SCM port, scm_print_state*) |
386 { | 389 { |
387 Lily_lexer *lexer = Lily_lexer::unsmob (s); | 390 Lily_lexer *lexer = Lily_lexer::unsmob (s); |
388 | 391 |
389 scm_puts ("#<Lily_lexer ", port); | 392 scm_puts ("#<Lily_lexer ", port); |
390 scm_display (lexer->scopes_, port); | 393 scm_display (lexer->scopes_, port); |
391 scm_puts (" >", port); | 394 scm_puts (" >", port); |
392 return 1; | 395 return 1; |
393 } | 396 } |
OLD | NEW |