Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(369)

Side by Side Diff: lily/lexer.ll

Issue 577840053: Use Scheme_hash_table for keyword handling
Patch Set: Minor consistency change Created 3 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 %{ // -*- mode: c++; c-file-style: "linux"; indent-tabs-mode: t -*- 1 %{ // -*- mode: c++; c-file-style: "linux"; indent-tabs-mode: t -*-
2 /* 2 /*
3 This file is part of LilyPond, the GNU music typesetter. 3 This file is part of LilyPond, the GNU music typesetter.
4 4
5 Copyright (C) 1996--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> 5 Copyright (C) 1996--2020 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 Jan Nieuwenhuizen <janneke@gnu.org> 6 Jan Nieuwenhuizen <janneke@gnu.org>
7 7
8 LilyPond is free software: you can redistribute it and/or modify 8 LilyPond is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or 10 the Free Software Foundation, either version 3 of the License, or
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 Lily_lexer::identifier_type (SCM sid) 918 Lily_lexer::identifier_type (SCM sid)
919 { 919 {
920 int k = try_special_identifiers (&yylval , sid); 920 int k = try_special_identifiers (&yylval , sid);
921 return k >= 0 ? k : SCM_IDENTIFIER; 921 return k >= 0 ? k : SCM_IDENTIFIER;
922 } 922 }
923 923
924 924
925 int 925 int
926 Lily_lexer::scan_escaped_word (const string &str) 926 Lily_lexer::scan_escaped_word (const string &str)
927 { 927 {
928 // use more SCM for this. 928 // use more SCM for this.
Dan Eble 2020/04/27 23:24:19 Is this what you've just done, or is there still m
dak 2020/04/27 23:37:35 Will remove. Not uploading separate patch just fo
929 929
930 //» SCM sym = ly_symbol2scm (str.c_str ()); 930 » SCM sym = ly_symbol2scm (str.c_str ());
931 931
932 yylval = SCM_UNSPECIFIED; 932 yylval = SCM_UNSPECIFIED;
933 » int i = lookup_keyword (str); 933 » int i = lookup_keyword (sym);
934 934
935 if (i != -1) 935 if (i != -1)
936 return i; 936 return i;
937 937
938 » SCM sid = lookup_identifier (str); 938 » SCM sid = lookup_identifier_symbol (sym);
939 if (Music *m = unsmob<Music> (sid)) 939 if (Music *m = unsmob<Music> (sid))
940 { 940 {
941 m->set_spot (override_input (here_input ())); 941 m->set_spot (override_input (here_input ()));
942 } 942 }
943 943
944 if (!SCM_UNBNDP (sid)) 944 if (!SCM_UNBNDP (sid))
945 return scan_scm_id (sid); 945 return scan_scm_id (sid);
946 946
947 string msg (_f ("unknown escaped string: `\\%s'", str)); 947 string msg (_f ("unknown escaped string: `\\%s'", str));
948 LexerError (msg.c_str ()); 948 LexerError (msg.c_str ());
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 { 1406 {
1407 (void) yy_start_stack_ptr; 1407 (void) yy_start_stack_ptr;
1408 (void) yy_start_stack_depth; 1408 (void) yy_start_stack_depth;
1409 (void) yy_start_stack; 1409 (void) yy_start_stack;
1410 (void) yy_push_state; 1410 (void) yy_push_state;
1411 (void) yy_pop_state; 1411 (void) yy_pop_state;
1412 (void) yy_top_state; 1412 (void) yy_top_state;
1413 (void) silence_lexer_warnings; 1413 (void) silence_lexer_warnings;
1414 } 1414 }
1415 #endif 1415 #endif
OLDNEW
« no previous file with comments | « lily/keyword.cc ('k') | lily/lily-lexer.cc » ('j') | lily/lily-lexer.cc » ('J')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b