From 04c607d288e4f7d5bd0bfe9f463a8d7d523b9398 Mon Sep 17 00:00:00 2001 From: nykwono Date: Mon, 5 Oct 2026 04:10:05 -0400 Subject: [PATCH] Implement numeric seperators --- polymod/hscript/_internal/Parser.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/polymod/hscript/_internal/Parser.hx b/polymod/hscript/_internal/Parser.hx index 564a7e9b..6c52c942 100644 --- a/polymod/hscript/_internal/Parser.hx +++ b/polymod/hscript/_internal/Parser.hx @@ -2445,6 +2445,12 @@ class Parser return TConst(CInt(n)); } } + case '_'.code: + char = readChar(); + if (![48, 49, 50, 51, 52, 53, 54, 55, 56, 57].contains(char)) + unexpected(TId('_')); // Throw an error if the seperator doesn't separate another number. + else + readPos--; // Move the position back as the while loop will make the char be re-read again. default: this.char = char; var i = Std.int(n);