mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
LibJS: Implement parsing and evaluation for AssignmentPatterns
e.g. `[...foo] = bar` can now be evaluated :^)
This commit is contained in:
parent
7fc6cd6b20
commit
1a9518ebe3
7 changed files with 104 additions and 40 deletions
|
@ -13,9 +13,12 @@ namespace JS {
|
|||
struct Position {
|
||||
size_t line { 0 };
|
||||
size_t column { 0 };
|
||||
size_t offset { 0 };
|
||||
};
|
||||
|
||||
struct SourceRange {
|
||||
[[nodiscard]] bool contains(Position const& position) const { return position.offset <= end.offset && position.offset >= start.offset; }
|
||||
|
||||
StringView filename;
|
||||
Position start;
|
||||
Position end;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue