LEFT | RIGHT |
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--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2020 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 |
11 LilyPond is distributed in the hope that it will be useful, | 11 LilyPond is distributed in the hope that it will be useful, |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 GNU General Public License for more details. | 14 GNU General Public License for more details. |
15 | 15 |
16 You should have received a copy of the GNU General Public License | 16 You should have received a copy of the GNU General Public License |
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. | 17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
18 */ | 18 */ |
19 | 19 |
20 #include "lily-lexer.hh" | 20 #include "lily-lexer.hh" |
21 | |
22 #include <cctype> | |
23 #include <sstream> | |
24 | 21 |
25 #include "context.hh" // for nested_property_alist | 22 #include "context.hh" // for nested_property_alist |
26 #include "international.hh" | 23 #include "international.hh" |
27 #include "interval.hh" | 24 #include "interval.hh" |
28 #include "main.hh" | 25 #include "main.hh" |
29 #include "moment.hh" | 26 #include "moment.hh" |
30 #include "parser.hh" | 27 #include "parser.hh" |
31 #include "scm-hash.hh" | 28 #include "scm-hash.hh" |
32 #include "source-file.hh" | 29 #include "source-file.hh" |
33 #include "warn.hh" | 30 #include "warn.hh" |
34 #include "program-option.hh" | 31 #include "program-option.hh" |
35 #include "lily-parser.hh" | 32 #include "lily-parser.hh" |
36 #include "ly-module.hh" | 33 #include "ly-module.hh" |
37 | 34 |
| 35 #include <cctype> |
| 36 #include <sstream> |
| 37 #include <unordered_map> |
| 38 |
38 using std::string; | 39 using std::string; |
39 | |
40 class Keyword_ent | |
41 { | |
42 public: | |
43 char const *name_; | |
44 int tokcode_; | |
45 }; | |
46 | 40 |
47 static std::unordered_map<std::string, int> keytable{ | 41 static std::unordered_map<std::string, int> keytable{ |
48 {"accepts", ACCEPTS}, | 42 {"accepts", ACCEPTS}, |
49 {"addlyrics", ADDLYRICS}, | 43 {"addlyrics", ADDLYRICS}, |
50 {"alias", ALIAS}, | 44 {"alias", ALIAS}, |
51 {"alternative", ALTERNATIVE}, | 45 {"alternative", ALTERNATIVE}, |
52 {"book", BOOK}, | 46 {"book", BOOK}, |
53 {"bookpart", BOOKPART}, | 47 {"bookpart", BOOKPART}, |
54 {"change", CHANGE}, | 48 {"change", CHANGE}, |
55 {"chordmode", CHORDMODE}, | 49 {"chordmode", CHORDMODE}, |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 scm_display (scopes_, port); | 362 scm_display (scopes_, port); |
369 scm_puts (" >", port); | 363 scm_puts (" >", port); |
370 return 1; | 364 return 1; |
371 } | 365 } |
372 | 366 |
373 bool | 367 bool |
374 Lily_lexer::is_clean () const | 368 Lily_lexer::is_clean () const |
375 { | 369 { |
376 return include_stack_.empty (); | 370 return include_stack_.empty (); |
377 } | 371 } |
LEFT | RIGHT |