diff options
author | John Wiegley <johnw@newartisans.com> | 2008-08-01 01:56:13 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-08-01 01:56:13 -0400 |
commit | c98be731733176c9e9afb690619d806630ec9090 (patch) | |
tree | aedd210699a652a2b77b2a1985c14a1bdd9c227a /token.h | |
parent | 567902b1731db6f1ace85a7bc384b55ffd0948ab (diff) | |
download | ledger-c98be731733176c9e9afb690619d806630ec9090.tar.gz ledger-c98be731733176c9e9afb690619d806630ec9090.tar.bz2 ledger-c98be731733176c9e9afb690619d806630ec9090.zip |
Re-implemented ?: parsing in value expressions. "a ? b : c" is implemented by
translating it into the equivalent syntax tree "(a & b) | c", since this
expression evaluates to the value of b if a is true, otherwise c.
Diffstat (limited to 'token.h')
-rw-r--r-- | token.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -71,6 +71,9 @@ struct expr_t::token_t : public noncopyable, public supports_flags<> KW_OR, // | KW_MOD, // % + QUERY, // ? + COLON, // : + COMMA, // , TOK_EOF, @@ -111,7 +114,7 @@ struct expr_t::token_t : public noncopyable, public supports_flags<> void rewind(std::istream& in); void unexpected(); - static void unexpected(char c, char wanted = '\0'); + static void expected(char wanted, char c = '\0'); }; } // namespace ledger |