diff options
author | acolyer <acolyer> | 2005-08-09 13:03:22 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-09 13:03:22 +0000 |
commit | f930586537b0e85ee43a4029fc656b9b0b3199ad (patch) | |
tree | f6b929401d29a094112411441594fe5bb1c9aeca /weaver | |
parent | 40ad6449866c092abb44f6a2286748778335e4e3 (diff) | |
download | aspectj-f930586537b0e85ee43a4029fc656b9b0b3199ad.tar.gz aspectj-f930586537b0e85ee43a4029fc656b9b0b3199ad.zip |
>> and >>> are lexed as tokens by the JDT parser. We always want >,> and >,>,> - yuck.
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/PatternParser.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java index b108b57b1..69d59cdae 100644 --- a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java +++ b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java @@ -1273,11 +1273,27 @@ public class PatternParser { } private void eat(String expectedValue,String expectedMessage) { - IToken next = tokenSource.next(); + IToken next = nextToken(); if (next.getString() != expectedValue) { + if (expectedValue.equals(">") && next.getString().startsWith(">")) { + // handle problem of >> and >>> being lexed as single tokens + pendingRightArrows = BasicToken.makeLiteral(next.getString().substring(1).intern(), "string", next.getStart()+1, next.getEnd()); + return; + } throw new ParserException(expectedMessage, next); } } + + private IToken pendingRightArrows; + private IToken nextToken() { + if (pendingRightArrows != null) { + IToken ret = pendingRightArrows; + pendingRightArrows = null; + return ret; + } else { + return tokenSource.next(); + } + } public boolean maybeEat(String token) { IToken next = tokenSource.peek(); |