1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

JSSpecCompiler: Get rid of ParseError in Lexer

This commit is contained in:
Dan Klishch 2024-01-20 19:47:02 -05:00 committed by Andrew Kaster
parent ed04aff1de
commit 9a2337f7ad
5 changed files with 125 additions and 88 deletions

View file

@ -31,13 +31,12 @@ inline constexpr StringView attribute_id = "id"sv;
inline constexpr StringView class_secnum = "secnum"sv;
ParseErrorOr<void> tokenize_string(SpecificationParsingContext& ctx, XML::Node const* node, StringView view, Vector<Token>& tokens);
struct TokenizeTreeResult {
Vector<Token> tokens;
struct StepTokenizationResult {
Optional<Vector<Token>> tokens;
XML::Node const* substeps = nullptr;
};
ParseErrorOr<TokenizeTreeResult> tokenize_tree(SpecificationParsingContext& ctx, XML::Node const* node, bool allow_substeps = false);
StepTokenizationResult tokenize_step(SpecificationParsingContext& ctx, XML::Node const* node);
Optional<Vector<Token>> tokenize_header(SpecificationParsingContext& ctx, XML::Node const* node);
}