diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-17 20:48:06 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-17 21:15:44 +0200 |
commit | 9624984557151e405d62f134e12270475d7ca7e7 (patch) | |
tree | 5a5204af65ba7f651798c6103cb67723a6dad512 /src/lex.cpp | |
parent | dd5fa160c23b206ed52d42a63e5edcc08fee6e48 (diff) | |
download | solar-9624984557151e405d62f134e12270475d7ca7e7.tar solar-9624984557151e405d62f134e12270475d7ca7e7.zip |
lex: change treatment of symbols which are neither all-uppercase or all-lowercase
Diffstat (limited to 'src/lex.cpp')
-rw-r--r-- | src/lex.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lex.cpp b/src/lex.cpp index 3c86f25..29bdd4e 100644 --- a/src/lex.cpp +++ b/src/lex.cpp @@ -241,17 +241,17 @@ int lex_t::lex_symbol(parse_token_value_t *value) { if (needspace) return syntax_error(value); - bool uc = true; - bool lc = true; + bool uc = false; + bool lc = false; do { switch (current()) { case 'A' ... 'Z': - lc = false; + uc = true; continue; case 'a' ... 'z': - uc = false; + lc = true; continue; case '0' ... '9': @@ -264,10 +264,8 @@ int lex_t::lex_symbol(parse_token_value_t *value) { value->str = get_token(); - if (uc) + if (uc && !lc) return TOK_SYMBOL_UC; - else if (lc) - return TOK_SYMBOL_LC; else return TOK_SYMBOL; } @@ -420,6 +418,7 @@ int lex_t::lex(parse_token_value_t *value) { case 'a' ... 'z': case 'A' ... 'Z': + case '_': return lex_symbol(value); case '%': |