Stabilize IParser API
See original GitHub issueIt’s currently flagged experimental:
@jerch any concerns about calling this stable? Any more tweaks in mind?
Not sure how many users there are but here’s VS Code’s single usage which seems to work well:
My only thought is we should think about the verb (add, register, etc.) and figure out where we want to go. I think add
feels a little strange without a remove
, VS Code uses register
for providers/handlers/factories:
Issue Analytics
- State:
- Created 4 years ago
- Comments:26 (26 by maintainers)
Top Results From Across the Web
IParser (HAPI FHIR - Core Library 6.3.5-SNAPSHOT API)
A parser, which can be used to convert between HAPI FHIR model/structure objects, and their respective String wire formats, in either XML or...
Read more >NVIDIA Deep Learning TensorRT Documentation
This NVIDIA TensorRT Developer Guide demonstrates how to use the C++ and Python APIs for implementing the most common deep learning layers.
Read more >konst - Rust - Docs.rs
This crate provides: Const fn equivalents of standard library functions and methods. Compile-time parsing through the Parser type, and parser_method macro.
Read more >AvaloniaUI/Avalonia - Gitter
Load(Stream stream, IParser parser) ---> System.MissingMethodException: Constructor on type 'Avalonia.Controls.Html.HtmlControl' not found. at System.
Read more >konst - crates.io: Rust Package Registry
Rust crates-io api-docs. Const equivalents of std functions and ... Use this whenever mutable references in const contexts are stabilized.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sdegutis Thx for the feedback. A few notes from my side:
Yes thats currently the only way to hook up something like a state change listener. But keep in mind that DECSET can freely stack param values, thus you will miss 1049 if its not the first param, e.g.
CSI ? ... ; 1049 ; ... h
.About regexp: Your regexp idea will not work for a simple reason - the parser acts on UTF32 codepoints not strings (and I am not keen to write a regexp parser for this lol). The function identifier gets translated into numbers which form a jump table key of handlers in the parser. Thats a quite low level processing of data, but the only way to keep the parser fast (in fact the key -> target jump is still quite costly).
A more general note on regexp and ANSI sequences - its almost impossible to get this right. There are simply too many ifs and elses in the parsing state that you would have to pull into the regexp itself. I think all regexp based packages trying to strip sequences from data get this wrong. To correctly grab DECSET 1049 by a regexp it would look more like:
(This is still slightly wrong but who cares, guess you get my point…)
So imho regexp doesnt work here for those two reasons.
@Tyriar To sum this up here - from my side this looks ready to get “official”. Gonna address the documentation issue separately with an article about sequences and hooks on the website.