From 1d7134e7f3e8868087fb3c089cb63407f798af92 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 28 Jul 2017 09:52:14 -0700 Subject: [PATCH] Make the decimal matching optional. --- src/org/nwapw/abacus/tree/TreeBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/nwapw/abacus/tree/TreeBuilder.java b/src/org/nwapw/abacus/tree/TreeBuilder.java index 9c57741..3f6b77f 100644 --- a/src/org/nwapw/abacus/tree/TreeBuilder.java +++ b/src/org/nwapw/abacus/tree/TreeBuilder.java @@ -37,7 +37,7 @@ public class TreeBuilder { lexer = new Lexer(){{ register(" ", TokenType.WHITESPACE); register(",", TokenType.COMMA); - register("[0-9]+(\\.[0-9]+)?", TokenType.NUM); + register("[0-9]*(\\.[0-9]+)?", TokenType.NUM); register("\\(", TokenType.OPEN_PARENTH); register("\\)", TokenType.CLOSE_PARENTH); }};