mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 13:18:19 +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
Notes:
sideshowbarker
2024-07-18 09:15:38 +09:00
Author: https://github.com/alimpfard
Commit: 1a9518ebe3
Pull-request: https://github.com/SerenityOS/serenity/pull/8641
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/davidot
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