-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[70_9] Parser: improve number_parser and keyword_parser for S7 Scheme #1871
Conversation
read_keyword (string s, int& i, string& result, array<char> extras) { | ||
int opos= i; | ||
int s_N = N (s); | ||
if (i < s_N && is_alpha (s[i])) i++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a keyword must start with alpha
!(s[pos] == '.' && pos + 1 < N (s) && is_digit (s[pos + 1]))) | ||
return; | ||
|
||
// Start with 0b, 0o, 0x | ||
if (can_parse_prefix_0b (s, pos)) { | ||
if (prefix_hash () && pos + 1 < N (s) && s[pos] == '#' && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for #t and #f
else { | ||
for (int j= 0; j < group_of_keywords_N; j++) { | ||
string word= get_label (group_of_keywords[j]); | ||
p_keyword_parser.put (utf8_to_cork (word), group); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when matching the keyword, string->number
is actually string-<gtr>number
What
#
prefixWhy
In S7 Scheme
How to test your changes?
Launch Mogan Research and check
TeXmacs/tests/tm/70_9.tm