1
Fork 0
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:
Ali Mohammad Pur 2021-07-11 01:16:17 +04:30 committed by Linus Groh
parent 7fc6cd6b20
commit 1a9518ebe3
7 changed files with 104 additions and 40 deletions

View file

@ -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;