summaryrefslogtreecommitdiff
path: root/src/token.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-15 16:34:34 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-15 16:34:34 -0400
commit6f7f87699c509131ab5ffff330ba77abbd58e829 (patch)
tree17960cb9541037bb05abed7c0b8b6cd949e72b05 /src/token.cc
parentfcd7f4f73b50ec02ec1f501a8ebde502c6736850 (diff)
Parse '/' in an operator context as "div"
Diffstat (limited to 'src/token.cc')
-rw-r--r--src/token.cc11
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 != '/');