diff options
author | John Wiegley <johnw@newartisans.com> | 2009-01-22 17:01:46 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-01-22 17:01:46 -0400 |
commit | fac5a95a486a1c0fdba3b8563503c977683888cf (patch) | |
tree | 61ca860ffa1e26dec483fc4cfa33c0c6c84ea2d0 /src/token.h | |
parent | 0b9f22b4d24e8fa545af2d7d448ddfe9fb3736ba (diff) | |
download | fork-ledger-fac5a95a486a1c0fdba3b8563503c977683888cf.tar.gz fork-ledger-fac5a95a486a1c0fdba3b8563503c977683888cf.tar.bz2 fork-ledger-fac5a95a486a1c0fdba3b8563503c977683888cf.zip |
Accept &&/and for &, ||/or for |, and not for !. Also improved error
reporting in the tokenizer.
Diffstat (limited to 'src/token.h')
-rw-r--r-- | src/token.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/token.h b/src/token.h index 3663c104..5502ad94 100644 --- a/src/token.h +++ b/src/token.h @@ -61,9 +61,9 @@ struct expr_t::token_t : public noncopyable STAR, // * KW_DIV, // / - EXCLAM, // ! - KW_AND, // & - KW_OR, // | + EXCLAM, // !, not + KW_AND, // &, &&, and + KW_OR, // |, ||, or KW_MOD, // % QUERY, // ? @@ -90,7 +90,7 @@ struct expr_t::token_t : public noncopyable token_t& operator=(const token_t& other) { if (&other == this) return *this; - assert(false); + assert(false); // only one token object is used at a time return *this; } @@ -104,6 +104,7 @@ struct expr_t::token_t : public noncopyable symbol[2] = '\0'; } + int parse_reserved_word(std::istream& in); void parse_ident(std::istream& in); void next(std::istream& in, const uint_least8_t flags); void rewind(std::istream& in); |