summaryrefslogtreecommitdiff
path: root/chapter01/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'chapter01/src/main/java/com')
-rw-r--r--chapter01/src/main/java/com/seaofnodes/simple/Parser.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/chapter01/src/main/java/com/seaofnodes/simple/Parser.java b/chapter01/src/main/java/com/seaofnodes/simple/Parser.java
index 8fb1ebaf..cdfff842 100644
--- a/chapter01/src/main/java/com/seaofnodes/simple/Parser.java
+++ b/chapter01/src/main/java/com/seaofnodes/simple/Parser.java
@@ -80,7 +80,7 @@ public class Parser {
* Parse integer literal
*
* <pre>
- * integerLiteral: [1-9][0-9]*
+ * integerLiteral: [1-9][0-9]* | [0]
* </pre>
*/
private ConstantNode parseIntegerLiteral(Lexer lexer) {
@@ -245,7 +245,7 @@ public class Parser {
private Token parsePuncuation() {
int start = _position-1;
- while( isPunctuation(nextChar()) );
+ if( isPunctuation(nextChar()) );
return Token.newPunct(new String(_input,start,--_position-start));
}