From 3de33483394559afba978d495377ee7098857eb7 Mon Sep 17 00:00:00 2001 From: Villezen Date: Wed, 18 Nov 2026 02:48:55 +0200 Subject: [PATCH] fix // comments not parsing on hashlink --- hscript/Parser.hx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hscript/Parser.hx b/hscript/Parser.hx index 21318bb1..dd49625f 100644 --- a/hscript/Parser.hx +++ b/hscript/Parser.hx @@ -2357,18 +2357,17 @@ class Parser { invalidChar(char); default: if( ops[char] ) { - var buf = new StringBuf(); - buf.addChar(char); + var op = String.fromCharCode(char); while( true ) { char = readChar(); if( StringTools.isEof(char) ) char = 0; if( !ops[char] ) { this.char = char; - return TOp(buf.toString()); + return TOp(op); } - var pop = buf.toString(); - buf.addChar(char); - var op = buf.toString(); + + var pop = op; + op += String.fromCharCode(char); if( allowRegex && op == "~/" ) { var e = readString(char, true); var f = readFlags(); @@ -2603,4 +2602,4 @@ class Parser { @:structInit final class PreprocValue { public var r : Bool; -} \ No newline at end of file +}