aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/anarres/cpp/Preprocessor.java
diff options
context:
space:
mode:
authorShevek <[email protected]>2015-05-19 13:33:20 -0700
committerShevek <[email protected]>2015-05-19 13:33:20 -0700
commit26f43a21561cdc5586ba8a8af78c548def36b3f2 (patch)
tree5159d6f6798eab1504b25798248a0f2f0e5ab3ea /src/main/java/org/anarres/cpp/Preprocessor.java
parent1ebba3bd75e2abea1b70ed36b5ffaa66f91d0649 (diff)
Fix #27: Don't preprocess pragma tokens.
Diffstat (limited to 'src/main/java/org/anarres/cpp/Preprocessor.java')
-rw-r--r--src/main/java/org/anarres/cpp/Preprocessor.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/anarres/cpp/Preprocessor.java b/src/main/java/org/anarres/cpp/Preprocessor.java
index 59d8ba8..1be126f 100644
--- a/src/main/java/org/anarres/cpp/Preprocessor.java
+++ b/src/main/java/org/anarres/cpp/Preprocessor.java
@@ -1322,7 +1322,7 @@ public class Preprocessor implements Closeable {
NAME:
for (;;) {
- Token tok = token();
+ Token tok = source_token();
switch (tok.getType()) {
case EOF:
/* There ought to be a newline before EOF.
@@ -1344,6 +1344,8 @@ public class Preprocessor implements Closeable {
name = tok;
break NAME;
default:
+ warning(tok,
+ "Illegal #" + "pragma " + tok.getText());
return source_skipline(false);
}
}
@@ -1352,7 +1354,7 @@ public class Preprocessor implements Closeable {
List<Token> value = new ArrayList<Token>();
VALUE:
for (;;) {
- tok = token();
+ tok = source_token();
switch (tok.getType()) {
case EOF:
/* There ought to be a newline before EOF.