summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lex.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/lex.cpp b/src/lex.cpp
index 2d56fef..3c86f25 100644
--- a/src/lex.cpp
+++ b/src/lex.cpp
@@ -279,6 +279,21 @@ int lex_t::lex(parse_token_value_t *value) {
loc.first_line = loc.last_line;
loc.first_column = loc.last_column+1;
+ if (dumb_mode) {
+ switch (current()) {
+ case 'a' ... 'z':
+ case 'A' ... 'Z':
+ case '0' ... '9':
+ case '_':
+ token = current();
+ next(true);
+ consume(false);
+ return token;
+ }
+ }
+
+ dumb_mode = false;
+
switch (current()) {
case ' ':
case '\n':
@@ -286,17 +301,9 @@ int lex_t::lex(parse_token_value_t *value) {
case '\r':
next(true);
consume(false);
- dumb_mode = false;
continue;
}
- if (dumb_mode) {
- token = current();
- next(true);
- consume(false);
- return token;
- }
-
switch (current()) {
case ';':
case ':':