diff options
Diffstat (limited to 'src/token.cc')
-rw-r--r-- | src/token.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/token.cc b/src/token.cc index 6935bc7a..0a8fce7e 100644 --- a/src/token.cc +++ b/src/token.cc @@ -38,7 +38,8 @@ int expr_t::token_t::parse_reserved_word(std::istream& in) { char c = static_cast<char>(in.peek()); - if (c == 'a' || c == 'd' || c == 'f' || c == 'o' || c == 'n' || c == 't') { + if (c == 'a' || c == 'd' || c == 'e' || c == 'f' || + c == 'i' || c == 'o' || c == 'n' || c == 't') { length = 0; char buf[6]; @@ -64,6 +65,16 @@ int expr_t::token_t::parse_reserved_word(std::istream& in) } break; + case 'e': + if (std::strcmp(buf, "else") == 0) { + symbol[0] = 'L'; + symbol[1] = 'S'; + symbol[2] = '\0'; + kind = KW_ELSE; + return 1; + } + break; + case 'f': if (std::strcmp(buf, "false") == 0) { kind = VALUE; @@ -72,6 +83,16 @@ int expr_t::token_t::parse_reserved_word(std::istream& in) } break; + case 'i': + if (std::strcmp(buf, "if") == 0) { + symbol[0] = 'i'; + symbol[1] = 'f'; + symbol[2] = '\0'; + kind = KW_IF; + return 1; + } + break; + case 'o': if (std::strcmp(buf, "or") == 0) { symbol[0] = '|'; |