diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/anarres/cpp/Preprocessor.java | 9 | ||||
-rw-r--r-- | src/main/java/org/anarres/cpp/Source.java | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/org/anarres/cpp/Preprocessor.java b/src/main/java/org/anarres/cpp/Preprocessor.java index f0e5528..c7a106a 100644 --- a/src/main/java/org/anarres/cpp/Preprocessor.java +++ b/src/main/java/org/anarres/cpp/Preprocessor.java @@ -522,7 +522,7 @@ public class Preprocessor implements Closeable { * @see #pop_source() */ // @CheckForNull - protected Source getSource() { + public Source getSource() { return source; } @@ -567,8 +567,11 @@ public class Preprocessor implements Closeable { && t != null) { /* We actually want 'did the nested source * contain a newline token', which isNumbered() - * approximates. This is not perfect, but works. */ - return line_token(t.getLine() + 1, t.getName(), " 2"); + * approximates. This is not perfect, but works. + * FIXME: Removed the '+ 1', since all lines were off by one. + * This solves this case, but I don't know _why_ this was here in the first place. + */ + return line_token(t.getLine() /* SEE ABOVE: + 1 */, t.getName(), " 2"); } return null; diff --git a/src/main/java/org/anarres/cpp/Source.java b/src/main/java/org/anarres/cpp/Source.java index ff7482a..817c162 100644 --- a/src/main/java/org/anarres/cpp/Source.java +++ b/src/main/java/org/anarres/cpp/Source.java @@ -104,7 +104,7 @@ public abstract class Source implements Iterable<Token>, Closeable { * * Sources form a singly linked list. */ - /* pp */ final Source getParent() { + public final Source getParent() { return parent; } |