summaryrefslogtreecommitdiffstats
path: root/src/lex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lex.cpp')
-rw-r--r--src/lex.cpp13
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 '%':