aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/anarres/cpp/MacroTokenSource.java
diff options
context:
space:
mode:
authorShevek <[email protected]>2008-06-13 21:33:42 +0000
committerShevek <[email protected]>2008-06-13 21:33:42 +0000
commit93808fc91f990dbc17a2bc2b350552d9dde89692 (patch)
tree508a92ebea86484622da1dff249fd118889f8bce /src/java/org/anarres/cpp/MacroTokenSource.java
parent4528d72b75208f21f8d5e7d72991b7d34b4e46cf (diff)
implement Feature.CSYNTAX, Feature.KEEPCOMMENTS, etc
Diffstat (limited to 'src/java/org/anarres/cpp/MacroTokenSource.java')
-rw-r--r--src/java/org/anarres/cpp/MacroTokenSource.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/java/org/anarres/cpp/MacroTokenSource.java b/src/java/org/anarres/cpp/MacroTokenSource.java
index b6500ff..264a1a6 100644
--- a/src/java/org/anarres/cpp/MacroTokenSource.java
+++ b/src/java/org/anarres/cpp/MacroTokenSource.java
@@ -111,9 +111,10 @@ import static org.anarres.cpp.Token.*;
int count = 2;
for (int i = 0; i < count; i++) {
if (!tokens.hasNext()) {
- err = new Token(ERROR,
- ptok.getLine(), ptok.getColumn(),
- ptok.getText(), "Paste at end of expansion");
+ /* XXX This one really should throw. */
+ error(ptok.getLine(), ptok.getColumn(),
+ "Paste at end of expansion");
+ buf.append(' ').append(ptok.getText());
break;
}
Token tok = tokens.next();
@@ -129,7 +130,8 @@ import static org.anarres.cpp.Token.*;
concat(buf, args.get(idx));
break;
/* XXX Test this. */
- case COMMENT:
+ case CCOMMENT:
+ case CPPCOMMENT:
break;
default:
buf.append(tok.getText());
@@ -156,10 +158,9 @@ import static org.anarres.cpp.Token.*;
if (arg != null) {
if (arg.hasNext()) {
Token tok = arg.next();
- if (tok.getType() == M_PASTE)
- tok = new Token(ERROR,
- tok.getLine(), tok.getColumn(),
- tok.getText(), "Unexpected paste token");
+ /* XXX PASTE -> INVALID. */
+ assert tok.getType() != M_PASTE :
+ "Unexpected paste token";
return tok;
}
arg = null;