Comments (2)
As a temporary fix, you can apply the following diff:
diff --git a/include/lexy/visualize.hpp b/include/lexy/visualize.hpp
index 1ad79fe9..1a12f3cb 100644
--- a/include/lexy/visualize.hpp
+++ b/include/lexy/visualize.hpp
@@ -392,7 +392,8 @@ OutputIt visualize_to(OutputIt out, lexy::lexeme<Reader> lexeme,
{
lexy::engine_cp_auto::error_code ec{};
auto cp = lexy::engine_cp_auto::parse(ec, reader);
- if (ec == lexy::engine_cp_auto::error_code::eof)
+ if (ec != lexy::engine_cp_auto::error_code{}
+ && !lexy::engine_cp_auto::recover(reader, ec))
break;
out = visualize_to(out, cp, opts);
I'm not quite happy with the way the error message is rendered (it will split the code point in half and report multiple invalid ones for each byte, as only some code units are underlined), so I'll need to take some time to come up with a proper fix.
from lexy.
This is now fixed, and it should report an error looking like this: https://lexy.foonathan.net/playground/?id=nEa7KjabK&mode=tree
from lexy.
Related Issues (20)
- Multiple input files HOT 1
- Wrong callback for `dsl::curly_bracketed.opt` HOT 2
- Problems using the scan action with parser state HOT 1
- Is there an easy way to get an error-string from a lexy::parse call?
- How to signal a parse error from a value callback?
- case_folding discards errors in validate and parse actions HOT 1
- How to access parse_state from dsl::scan or lexy::rule_scanner?
- Statis assertion failure regression on scanner.branch HOT 7
- error: no member named 'p' in 'AIR::(lambda ...) HOT 2
- Documentation error for dsl::until
- Add examples for parse HOT 3
- Web breaks in firefox HOT 1
- Support std::filesystem::path for input file HOT 1
- Support `code_point.range` for any byte encoding HOT 3
- location tracking for operators HOT 2
- dsl::delimited loops forever when an invalid codepoint is encountered HOT 1
- `$BRANCH_RULE + dsl::position` is not treated as a branch rule? HOT 2
- problem with `lexy::callback_with_state` HOT 3
- Find a way to provide the line that doesn't compile in the compilation error HOT 4
- Static assertion failure in benchmarks/swar/main.cpp for MSVC HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lexy.