From 413e9aaf7bab9827c2e5a3ca24f49b866452441f Mon Sep 17 00:00:00 2001 From: grepsuzette Date: Mon, 16 Mar 2020 19:27:54 +0800 Subject: [PATCH] fix "Error while reading config: ErrorException: A non-numeric value encountered in /www/xxxx/Parser.php:450 " The exception is not thrown by yaml itself but by PHP because this line in Parser.captureSegment(): result += _result; Gets naively compiled in PHP (result is a Dynamic). So I propose to change it to: result += Std.string(_result); Stack trace: #0 /www/xxx/lib/yaml/Parser.php(450): php\Boot::php\{closure}() #1 /www/xxx/lib/yaml/Parser.php(2284): yaml\Parser->captureSegment() #2 /www/xxx/lib/yaml/Parser.php(574): yaml\Parser->readPlainScalar() #3 /www/xxx/lib/yaml/Parser.php(1169): yaml\Parser->composeNode() #4 /www/xxx/lib/yaml/Parser.php(553): yaml\Parser->readBlockMapping() #5 /www/xxx/lib/yaml/Parser.php(1757): yaml\Parser->composeNode() #6 /www/xxx/lib/yaml/Parser.php(991): yaml\Parser->readDocument() #7 /www/xxx/lib/yaml/Parser.php(812): yaml\Parser->parseAll() #8 /www/xxx/lib/yaml/Yaml.php(33): yaml\Parser->parse() #9 /www/xxx/lib/yaml/Yaml.php(49): yaml\Yaml::parse() --- src/yaml/Parser.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yaml/Parser.hx b/src/yaml/Parser.hx index 2c0d5ca..bb18bd8 100644 --- a/src/yaml/Parser.hx +++ b/src/yaml/Parser.hx @@ -307,7 +307,7 @@ class Parser } } - result += _result; + result += Std.string(_result); } }