From 6f7f87699c509131ab5ffff330ba77abbd58e829 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Feb 2009 16:34:34 -0400 Subject: Parse '/' in an operator context as "div" --- src/token.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/token.cc') 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 != '/'); -- cgit v1.2.3