aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/anarres
diff options
context:
space:
mode:
authorShevek <[email protected]>2013-12-28 05:07:31 -0800
committerShevek <[email protected]>2013-12-28 05:07:31 -0800
commit4193b7effd117c31c15452aa7beef48ee29d79c2 (patch)
treea8a9ae97e4064469f231914c0d69907a03ea5047 /src/main/java/org/anarres
parentefc10c0f0bc0e8c245282fc55d28adb2ce1967eb (diff)
Implement varargs macros, courtesy ochafik
Diffstat (limited to 'src/main/java/org/anarres')
-rw-r--r--src/main/java/org/anarres/cpp/Preprocessor.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/anarres/cpp/Preprocessor.java b/src/main/java/org/anarres/cpp/Preprocessor.java
index f636872..6fb3249 100644
--- a/src/main/java/org/anarres/cpp/Preprocessor.java
+++ b/src/main/java/org/anarres/cpp/Preprocessor.java
@@ -905,6 +905,13 @@ public class Preprocessor implements Closeable {
case IDENTIFIER:
args.add(tok.getText());
break;
+ case ELLIPSIS:
+ // Unnamed Variadic macro
+ args.add("__VA_ARGS__");
+ // We just named the ellipsis, but we unget the token
+ // to allow the ELLIPSIS handling below to process it.
+ source_untoken(tok);
+ break;
case NL:
case EOF:
error(tok,