diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-15 16:34:34 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-15 16:34:34 -0400 |
commit | 6f7f87699c509131ab5ffff330ba77abbd58e829 (patch) | |
tree | 17960cb9541037bb05abed7c0b8b6cd949e72b05 /src/token.cc | |
parent | fcd7f4f73b50ec02ec1f501a8ebde502c6736850 (diff) | |
download | fork-ledger-6f7f87699c509131ab5ffff330ba77abbd58e829.tar.gz fork-ledger-6f7f87699c509131ab5ffff330ba77abbd58e829.tar.bz2 fork-ledger-6f7f87699c509131ab5ffff330ba77abbd58e829.zip |
Parse '/' in an operator context as "div"
Diffstat (limited to 'src/token.cc')
-rw-r--r-- | src/token.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/token.cc b/src/token.cc index 9311f60a..6286870b 100644 --- a/src/token.cc +++ b/src/token.cc @@ -272,14 +272,9 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags) case '/': { in.get(c); - c = in.peek(); - if (c == '/') { - in.get(c); - symbol[1] = c; - symbol[2] = '\0'; - kind = KW_DIV; - length = 2; - } else { + if (pflags & PARSE_OP_CONTEXT) { // operator context + kind = SLASH; + } else { // terminal context // Read in the regexp char buf[256]; READ_INTO_(in, buf, 255, c, length, c != '/'); |