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
commit 1a9518ebe3
Notes: sideshowbarker 2024-07-18 09:15:38 +09:00
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;