Skip to content

Commit

Permalink
fix "Error while reading config: ErrorException: A non-numeric value …
Browse files Browse the repository at this point in the history
…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}()
    mikestead#1 /www/xxx/lib/yaml/Parser.php(2284): yaml\Parser->captureSegment()
    mikestead#2 /www/xxx/lib/yaml/Parser.php(574): yaml\Parser->readPlainScalar()
    mikestead#3 /www/xxx/lib/yaml/Parser.php(1169): yaml\Parser->composeNode()
    mikestead#4 /www/xxx/lib/yaml/Parser.php(553): yaml\Parser->readBlockMapping()
    mikestead#5 /www/xxx/lib/yaml/Parser.php(1757): yaml\Parser->composeNode()
    mikestead#6 /www/xxx/lib/yaml/Parser.php(991): yaml\Parser->readDocument()
    mikestead#7 /www/xxx/lib/yaml/Parser.php(812): yaml\Parser->parseAll()
    mikestead#8 /www/xxx/lib/yaml/Yaml.php(33): yaml\Parser->parse()
    mikestead#9 /www/xxx/lib/yaml/Yaml.php(49): yaml\Yaml::parse()
  • Loading branch information
grepsuzette committed Mar 16, 2020
1 parent 1578d54 commit 413e9aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/yaml/Parser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class Parser
}
}

result += _result;
result += Std.string(_result);
}
}

Expand Down

0 comments on commit 413e9aa

Please sign in to comment.