We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d47d39 commit 15b782dCopy full SHA for 15b782d
src/script_parser.cpp
@@ -13,11 +13,13 @@ using ErrorReport = lexy_ext::_report_error<char*>;
13
14
Expected<ScriptFunction> ParseScript(const std::string& script)
15
{
16
- char error_msgs_buffer[2048];
+ std::string error_msgs_buffer; // dynamically growing error buffer
17
18
auto input = lexy::string_input<lexy::utf8_encoding>(script);
19
+
20
+ auto reporter = ErrorReport().to(std::back_inserter(error_msgs_buffer));
21
auto result =
- lexy::parse<BT::Grammar::stmt>(input, ErrorReport().to(error_msgs_buffer));
22
+ lexy::parse<BT::Grammar::stmt>(input, reporter);
23
if(result.has_value() && result.error_count() == 0)
24
25
try
0 commit comments