From 3710e583796ffa29966f4dbcfebce0d847d8b401 Mon Sep 17 00:00:00 2001 From: Alexander Zubkov <41280743+alexander-zubkov@users.noreply.github.com> Date: Fri, 14 Jul 2023 23:32:07 +0500 Subject: [PATCH] A variable can contains digits (#35) --- lib/src/parser.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/parser.dart b/lib/src/parser.dart index 6766a88..388b5ae 100644 --- a/lib/src/parser.dart +++ b/lib/src/parser.dart @@ -251,6 +251,10 @@ class Lexer { // Check if the current string is a Number. If it's the case add the string to the intBuffer. StringBuffer sb = StringBuffer(intBuffer); try { + // A variable can contains digits + if (varBuffer.isNotEmpty) { + throw FormatException(); + } int.parse(si); // The current string is a number and it is added to the intBuffer. sb.write(si);