mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:57:35 +00:00
AK+LibXML+JSSpecCompiler: Move LineTrackingLexer to AK
This is a simple extension of GenericLexer, and is used in more than just LibXML, so let's move it into AK. The move also resolves a FIXME, which is removed in this commit.
This commit is contained in:
parent
08c02ad888
commit
bc301b6f40
8 changed files with 79 additions and 78 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/GenericLexer.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Variant.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -19,12 +20,6 @@ struct Attribute {
|
|||
ByteString value;
|
||||
};
|
||||
|
||||
struct Offset {
|
||||
size_t offset { 0 };
|
||||
size_t line { 0 };
|
||||
size_t column { 0 };
|
||||
};
|
||||
|
||||
struct Node {
|
||||
struct Text {
|
||||
StringBuilder builder;
|
||||
|
@ -40,7 +35,7 @@ struct Node {
|
|||
|
||||
bool operator==(Node const&) const;
|
||||
|
||||
Offset offset;
|
||||
LineTrackingLexer::Position offset;
|
||||
Variant<Text, Comment, Element> content;
|
||||
Node* parent { nullptr };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue