Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New lexer #559

Merged
merged 321 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
321 commits
Select commit Hold shift + click to select a range
910ba1a
Continuing to adapt parser to new cursor returns
Jun 22, 2020
61b1c68
Fix multiple mutable cursor reference
Jun 22, 2020
354cf1a
Updated benchmarks lexer/parser usage
Jun 22, 2020
3dda033
Updated cli/wasm usage of parser
Jun 22, 2020
9715bae
Back to a compiling state
Jun 22, 2020
68f41fa
Seperated cursor peek and peek(skip > 0)
Jun 22, 2020
067e310
VecDeque used to allow peeking 1 ahead
Jun 24, 2020
efb0ab3
Removing back/prev from parser cursor
Jun 24, 2020
efc6bc1
Fixed peek_more parser cursor which caused infinite loop
Jun 27, 2020
8dc3159
Modified parser cursor.expect behaviour to fit usage
Jun 28, 2020
0f9b23b
Traced down / fixed bug related to semicolon insertion
Jun 28, 2020
da68b13
Added push-back() which seems to be required for parsing the differen…
Jun 28, 2020
554ae90
Fixed bug where line terminators were not ignored during object liter…
Jun 28, 2020
e48de3d
Fixed bug where line terminators were rejected within object literal …
Jun 28, 2020
16480d9
fixed bug where anonymous functions as function arguments could not b…
Jun 28, 2020
bd08224
Fixed bug with line terminators being supported in WhileLoop
Jun 28, 2020
8b57683
Removed need for special peek_semicolon with do_while flag
Jun 28, 2020
4c0b798
Added dowhile semicolon insertion
Jun 28, 2020
273b1e4
Fixed bug where line terminators were not allowed between parts of do…
Jun 28, 2020
a5cd476
Disabled 2 new lexer tests which didn't pass anyway
Jun 28, 2020
9370e6f
Cargo fmt
Jun 28, 2020
548ae5e
Cleanup
Jun 28, 2020
f22f171
Fmt
Jun 28, 2020
ac1d238
Tidying
Jun 28, 2020
32fb242
Merge pull request #19 from Lan2u/bug_fix
Jun 28, 2020
dde8893
Starting to add goal symbol set statements
Jun 28, 2020
7af447a
Added goal symbol set to expression parser macro
Jun 29, 2020
03690ff
Trying to workout where to put goal symbols
Jun 29, 2020
7932837
Merge pull request #20 from Lan2u/new_parser_lexer
Jun 29, 2020
40db5f7
Added a 'fallback' mechanism to try and regex if a div is found unexp…
Jul 3, 2020
4657f18
All tests pass
Jul 3, 2020
d740164
Removed println statements
Jul 3, 2020
60004cf
Added tests showing handling of ambigious regex/div case
Jul 3, 2020
8342712
Fmt
Jul 3, 2020
98a6faa
Disabled the expression lexer benchmark
Jul 3, 2020
d501b09
Downgraded some cursor pub fn to fn
Jul 3, 2020
b96b614
Tidy up spread literal lex()
Jul 3, 2020
d665540
fixed a couple small warnings
Jul 3, 2020
1914c66
Changed lexer peek() to return values rather than references
Jul 3, 2020
440bcbb
Handled peek error returns
Jul 3, 2020
b0c6f07
Making clippy happier
Jul 3, 2020
253f30c
Making clippy happier
Jul 3, 2020
8c261af
Removed macro for chosing branch in lexer
Jul 3, 2020
9b90eef
Cleaning up, making clippy happier
Jul 3, 2020
080c2be
The insatiable clippy continues
Jul 3, 2020
b021cd0
Fmt
Jul 3, 2020
5495371
Fmt, clippy
Jul 3, 2020
7a97e71
Making clippy happy... continues...
Jul 3, 2020
36ebeb4
Tidying up
Jul 4, 2020
4ee16ed
Clippy is happier, needed to force allow certain closures which were …
Jul 4, 2020
7550cd3
Tidying cursor, modify peek_more to peek_skip
Jul 4, 2020
0fafe1c
Merged master into new lexer
Jul 4, 2020
ff4d906
Merge branch 'boa-dev-master' into new_lexer
Jul 4, 2020
80c6e19
fixed bug where old expect behaviour used on switch
Jul 4, 2020
2ee2e81
Fmt, clippy happy, all tests pass
Jul 4, 2020
2aac403
Attempting to fix issues with benchmarks
Jul 4, 2020
d040362
Fixed bug in array decl not allowing line terminators
Jul 4, 2020
5d46cdd
fmt
Jul 4, 2020
76e8431
Fixed bug with line terminators being rejected in object arguments
Jul 4, 2020
c8966a1
Update boa/src/syntax/lexer/number.rs
Jul 5, 2020
93e39b4
Update boa/src/builtins/array/tests.rs
Jul 5, 2020
a723479
Update boa/src/syntax/lexer/cursor.rs
Jul 5, 2020
526674f
Update boa/src/syntax/parser/cursor.rs
Jul 5, 2020
f4c245c
Update boa/src/syntax/parser/expression/assignment/mod.rs
Jul 5, 2020
7918bf8
Update boa/src/syntax/lexer/cursor.rs
Jul 5, 2020
ef01d58
Fixes as per PR review
Jul 5, 2020
86dcaa4
Cleaning up number lexing
Jul 5, 2020
e3962d9
Tidying, removed .unwrap()'s
Jul 5, 2020
db3df44
Tidy up based on PR reviews
Jul 5, 2020
009e878
Tidying
Jul 5, 2020
7367cf8
Used transpose as per PR comment
Jul 5, 2020
45e7d15
Removed error returns in number in favour of immediate panic
Jul 5, 2020
c224cd4
Started refractor for cursor to return Result<Option<>>
Jul 5, 2020
f5f1976
Number lexing change
Jul 5, 2020
f06c23b
Fixing unused result warnings
Jul 5, 2020
717b379
Finished refractor
Jul 5, 2020
7ba083d
Merge branch 'master' into new_lexer
Jul 7, 2020
4a13cbe
Update boa/src/syntax/parser/expression/update.rs
Jul 7, 2020
952c87d
Fixed error preventing compilation
Jul 7, 2020
abbbcf0
Added missing doc comments
Jul 7, 2020
c62830e
Missing doc
Jul 7, 2020
df2ece8
Switched multiple operator spec links for a single parent link
Jul 7, 2020
7d20427
Refractor of benchmark
Jul 7, 2020
29a2cbb
Removed expression_lexer benchmark
Jul 8, 2020
5cc967f
Fixed comments consuming line terminator (with test)
Jul 8, 2020
d9fa2b8
Updated test to reflect change to single-line comments
Jul 8, 2020
4da7fc2
Small changes as per PR review
Jul 8, 2020
a5cdaa8
Modified multiline comment behaviour to return line terminator if enc…
Jul 8, 2020
93b4dc7
Update boa/src/syntax/lexer/comment.rs
Jul 8, 2020
08aba33
Merge pull request #24 from boa-dev/master
Jul 9, 2020
71488aa
Fixed goal symbol benchmark
Jul 9, 2020
e26c12e
Inline set/get goal
Jul 9, 2020
d338069
Merge branch 'master' into new_lexer
Jul 11, 2020
c6383e8
fmt
Jul 11, 2020
a892776
Merge branch 'master' into new_lexer
Jul 12, 2020
6fe6192
Fixed string generation, trying to add a faster path for context swit…
Razican Jul 13, 2020
b8ca90d
Added a bunch more profiling timers
Razican Jul 13, 2020
0efe2a4
Trying to reduce type conversions in numeric literals
Razican Jul 13, 2020
acdea41
Peek_skip impl
Jul 15, 2020
1e970b0
Initial non-vec dequeue impl
Jul 15, 2020
12ec8ce
Merge branch 'new_lexer' into new_lexer_no_heap_peek
Jul 15, 2020
668c001
Removed peeked_back field
Jul 15, 2020
5d55623
Merge branch 'new_lexer_no_heap_peek' of https://github.com/boa-dev/b…
Jul 15, 2020
985f68e
Merge pull request #566 from boa-dev/new_lexer_no_heap_peek
Jul 15, 2020
2f9eec0
Fixed error where number > usize size was used
Jul 15, 2020
a135496
Converted peek to implicitly skip line terminators
Jul 17, 2020
30b7c10
Moving the work of skipping line terminators into the lexer
Jul 17, 2020
4cbe875
Replaced different methods in parser with a skip terminators option
Jul 17, 2020
47dad7d
Added argument to peek/next to skip line terminators
Jul 17, 2020
895cb9e
Made clippy happier
Jul 17, 2020
845012e
Peek now discards a line terminator (if flag set) even if one was al…
Jul 17, 2020
fc79506
Removed some usages of peek/next with skip line terminator allowing m…
Jul 17, 2020
5fbf714
Bringing across HalidoDat's stackoverflow fixes
Jul 17, 2020
5282d79
Bringing across HalidoDat's stackoverflow fixes (2/2)
Jul 17, 2020
a9b4328
Re-added rmeoved bit of number tests
Jul 17, 2020
0d4e53f
Basically back to where I started
Jul 17, 2020
ade3ced
Fixed bug with parse generalised
Jul 21, 2020
c378bf6
All tests pass
Jul 21, 2020
53f2f6f
Revert changes to test running
Jul 21, 2020
ae23b81
Removed skip_line_terminators
Jul 21, 2020
c265074
Comment
Jul 21, 2020
742c6fb
Comment
Jul 21, 2020
bf8f180
Removed an instance of try_parse
Jul 21, 2020
e1e4253
Removed another try_parse usage
Jul 21, 2020
0d8055e
Removed further try_parse usage
Jul 21, 2020
c7750b8
Removed binding init try_parse!
Jul 21, 2020
8032cfc
Fmt, clippy
Jul 21, 2020
df7cc19
Removed arrow function try_parse
Jul 22, 2020
cda8b21
try_parse removed
Jul 22, 2020
a06ec8b
Removed debug statements
Jul 22, 2020
186c7bf
Merge pull request #584 from boa-dev/new_lexer_peek_explicit
Jul 22, 2020
4b37936
Merge branch 'master' into new_lexer
Jul 22, 2020
a0cfe00
Added test covering desired behaviour
Jul 24, 2020
7abd96e
Addressed line terminators within assignment expression
Jul 24, 2020
eb7ea48
Syntax error now thrown on assignment to constant
Jul 24, 2020
c321658
Added array decl assignment tests + impl
Jul 24, 2020
968fd48
Added assign to object test
Jul 24, 2020
4a4f0de
Moved tests
Jul 25, 2020
e208a4d
Refractored tests to check for presence of 'Syntax Error:' rather tha…
Jul 26, 2020
f2a493e
Merge branch 'master' into new_lexer
Jul 29, 2020
5574963
fixed merge
Jul 29, 2020
feb7f55
Merge branch 'master' into new_lexer
Jul 29, 2020
074cb6c
fixed compliation error
Jul 29, 2020
1e5b65d
Added test to refine the current problem in the parser
Jul 29, 2020
720eea9
Added further test to demonstrate issue
Jul 29, 2020
a8a4d9c
Added test to differentiate between (b) and (a,b)
Aug 1, 2020
8493e7d
Expanded check to differentiate between (expr) and (a) => {}
Aug 1, 2020
c8734b8
Identified need to peek ahead upto 4 tokens
Aug 1, 2020
d9f427e
fmt, clippy
Aug 1, 2020
6a949c4
Switched to new mechanism allowing arbitary peek buffer size
Aug 2, 2020
bcb8874
Moved parser cursor to add cursor specific tests
Aug 2, 2020
d781ed2
Added some cursor specific tests
Aug 2, 2020
79c9c69
Added more cursor tests
Aug 2, 2020
faf073d
Implementing skip already peeked line terminators + added comments
Aug 2, 2020
d4a5026
Further improved documentation of desired behaviour of peek_skip
Aug 2, 2020
32c39c0
Skip peeked terminators doc test passes
Aug 2, 2020
64f704f
Peek_skip now works upto skip_n == 3
Aug 2, 2020
f365447
Removed peek_skip, replaced with a singular peek() function
Aug 2, 2020
b6496e7
Cleanup
Aug 2, 2020
afeb278
Updated usages of peek_skip with peek in documentation
Aug 2, 2020
aa1ed65
Replaced push_back in assignment with peek(2)
Aug 2, 2020
44d81f1
Fixed arrow function detection with empty args
Aug 2, 2020
c820625
All tests including new (expr) tests pass
Aug 2, 2020
aa952a2
Cleanup, removed debug statements
Aug 2, 2020
685828d
Removed push_back
Aug 2, 2020
8f7f3ee
Additional docs
Aug 2, 2020
2c4898c
Merge branch 'new_lexer' into issue_588
Aug 2, 2020
a9f5dca
Refractor to seperate lexer buffering from rest of parse cursor
Aug 2, 2020
e71a12e
Make clippy happy
Aug 2, 2020
f4fa102
Merge pull request #593 from boa-dev/issue_588
Aug 2, 2020
d4075aa
Remove duplicated "Parsing Error: Syntax Error:" messages
Razican Aug 3, 2020
54c3e2f
Update boa/src/syntax/parser/cursor/buffered_lexer/mod.rs
Razican Aug 14, 2020
1d94f34
Fixes for the new lexer (#632)
Razican Aug 16, 2020
f7fce7f
Merge branch 'master' into new_lexer
Aug 16, 2020
1952db1
Fixed merge issue with .to_length()
Aug 16, 2020
3b586ae
Removed track_caller usage for now
Aug 16, 2020
78c4e64
Small size optimization
Razican Aug 17, 2020
1fdf734
Merge branch 'master' into new_lexer
Aug 17, 2020
4a50895
Fixed merge issue
Aug 17, 2020
bab4dba
Small optimization
Razican Aug 19, 2020
9e72203
Merge branch 'new_lexer' of github.com:boa-dev/boa into new_lexer
Razican Aug 19, 2020
5844588
Removed one warning
Razican Aug 19, 2020
a1f7e48
Removed one print statement that was slowing things down
Razican Aug 19, 2020
fa81099
Better error output for parsing errors
Razican Aug 19, 2020
7887750
Added proper instanceof parsing, but still no execution
Razican Aug 19, 2020
e8053a4
Added "unimplemented" errors for for...in and for...of statements
Razican Aug 19, 2020
5765066
Merge branch 'master' into new_lexer
Aug 19, 2020
ebb79db
Merge branch 'master' into new_lexer
Aug 19, 2020
21d200b
Update boa/src/lib.rs
Aug 20, 2020
58d5f06
CRLF -> LF
Razican Aug 20, 2020
1fa0228
Merge branch 'new_lexer' of github.com:boa-dev/boa into new_lexer
Razican Aug 20, 2020
8e58ea0
Merge branch 'master' into new_lexer
Aug 20, 2020
58bfa45
Fix to benchmark merge issue
Aug 20, 2020
bcbb8ac
Update boa/src/syntax/parser/statement/iteration/while_statement.rs
Razican Aug 20, 2020
88c0b2d
Update boa/src/syntax/parser/statement/if_stm/mod.rs
Razican Aug 20, 2020
aae6361
Upgraded dependencies
Razican Aug 20, 2020
346d283
Merge branch 'new_lexer' of github.com:boa-dev/boa into new_lexer
Razican Aug 20, 2020
53d036f
Removed lexer individual benchmarks
Aug 20, 2020
6a4318b
updated Cargo.toml
Aug 20, 2020
a5494f7
Update boa/src/syntax/parser/function/mod.rs
Razican Aug 21, 2020
79a0838
Update boa/src/syntax/parser/function/mod.rs
Razican Aug 21, 2020
7a01076
Update boa/src/syntax/parser/mod.rs
Razican Aug 21, 2020
887635b
Update boa/src/syntax/lexer/operator.rs
Razican Aug 21, 2020
0261978
Update boa/src/syntax/lexer/operator.rs
Razican Aug 21, 2020
f46f85b
Update boa/src/syntax/parser/function/mod.rs
Razican Aug 21, 2020
f7de982
Update boa/src/syntax/parser/function/mod.rs
Razican Aug 21, 2020
42e2eb7
Update boa/src/syntax/parser/function/mod.rs
Razican Aug 21, 2020
1f2fe51
Update boa/src/syntax/parser/expression/primary/object_initializer/mo…
Razican Aug 21, 2020
8308068
Update boa/src/syntax/parser/expression/primary/object_initializer/mo…
Razican Aug 21, 2020
92d1794
Update boa/src/syntax/parser/expression/primary/mod.rs
Razican Aug 21, 2020
15dc936
Update boa/src/syntax/parser/expression/primary/mod.rs
Razican Aug 21, 2020
584ac69
Update boa/src/syntax/parser/expression/assignment/mod.rs
Razican Aug 21, 2020
1b43138
Update boa/src/syntax/lexer/regex.rs
Razican Aug 21, 2020
2607955
Update boa/src/syntax/lexer/regex.rs
Razican Aug 21, 2020
cccec7c
Update boa/src/syntax/lexer/number.rs
Razican Aug 21, 2020
01bf292
Apply suggestions from code review
Razican Aug 21, 2020
2b00177
Solved some feedback comments
Razican Aug 21, 2020
24b0b07
Update boa/src/syntax/lexer/operator.rs
Razican Aug 21, 2020
2edc6e5
Apply suggestions from code review
Razican Aug 21, 2020
34f8093
Apply suggestions from code review
Razican Aug 21, 2020
bafcb63
cargo fmt
Razican Aug 21, 2020
1886c64
Tidy identifier lex
Aug 21, 2020
b21affe
Update boa/benches/parser.rs
Razican Aug 21, 2020
c88f498
Apply suggestions from code review
Razican Aug 21, 2020
b7275f5
Update boa/src/syntax/lexer/mod.rs
Razican Aug 21, 2020
dd66d2c
Update boa/src/syntax/lexer/spread.rs
Razican Aug 21, 2020
1120d8e
Fixed if statement unwrap()
Aug 22, 2020
5a270c3
Renamed take_while_pred
Aug 22, 2020
751e669
Removed unneeded comment
Aug 22, 2020
5e9bc25
Cleaned up member, removed unneeded clone
Aug 22, 2020
87dd0ba
Removed ability to dump tokens
Aug 22, 2020
c496b3f
Removed old comment
Aug 22, 2020
f58720c
Removed old/no-longer true comments
Aug 22, 2020
f7f6703
Removed out-dated comment
Aug 22, 2020
64f2e99
Reenabled test which now passes
Aug 22, 2020
f2070c8
Added module level documentation to lexer
Aug 22, 2020
4d191d6
Removed unwrap in callexpression
Aug 22, 2020
d9a53c3
Clarified function
Aug 22, 2020
a579cf9
Updated arrow_function to make it more clear that the (expr) case sho…
Aug 22, 2020
1b7697f
Removed old comment
Aug 22, 2020
7f23537
Catchup new_lexer (#657)
Aug 22, 2020
3cae888
Fixed benchmarks
Aug 22, 2020
56ee013
Merge branch 'master' into new_lexer
Aug 22, 2020
d1a250f
Fixed merge
Aug 22, 2020
cd91bfb
Added position to lex syntax error
Aug 22, 2020
87bd988
Added some position tests
Aug 25, 2020
fd1b36d
Added syntax error position checks to tests
Aug 25, 2020
f6fd3bb
Update boa/src/syntax/lexer/cursor.rs
Aug 27, 2020
0d7ad6c
Update boa/src/syntax/lexer/tests.rs
Aug 27, 2020
86b0267
fmt
Aug 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
30 changes: 30 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto

#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
*.css eol=lf
*.htm eol=lf
*.html eol=lf
*.js eol=lf
*.json eol=lf
*.sh eol=lf
*.txt eol=lf
*.yml eol=lf
*.rs eol=lf
*.toml eol=lf
*.lock eol=lf
*.md eol=lf
*.svg eol=lf

# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.gif binary
*.ico binary
*.jar binary
*.jpg binary
*.jpeg binary
*.png binary
109 changes: 48 additions & 61 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ FLAGS:
-V, --version Prints version information

OPTIONS:
-a, --dump-ast <FORMAT> Dump the ast to stdout with the given format [possible values: Debug, Json,
JsonPretty]
-t, --dump-tokens <FORMAT> Dump the token stream to stdout with the given format [possible values: Debug, Json,
-a, --dump-ast <FORMAT> Dump the abstract syntax tree (ast) to stdout with the given format [possible values: Debug, Json,
JsonPretty]

ARGS:
Expand Down
16 changes: 6 additions & 10 deletions boa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ profiler = ["measureme", "once_cell"]

[dependencies]
gc = { version = "0.3.6", features = ["derive"] }
serde_json = "1.0.56"
serde_json = "1.0.57"
rand = "0.7.3"
num-traits = "0.2.12"
regex = "1.3.9"
rustc-hash = "1.1.0"
num-bigint = { version = "0.3.0", features = ["serde"] }
num-integer = "0.1.43"
bitflags = "1.2.1"
indexmap = "1.4.0"
indexmap = "1.5.1"
ryu-js = "0.2.0"
chrono = "0.4"
chrono = "0.4.15"

# Optional Dependencies
serde = { version = "1.0.114", features = ["derive"], optional = true }
serde = { version = "1.0.115", features = ["derive"], optional = true }
measureme = { version = "0.7.1", optional = true }
once_cell = { version = "1.4.0", optional = true }
once_cell = { version = "1.4.1", optional = true }

[dev-dependencies]
criterion = "=0.3.2"
Expand All @@ -43,10 +43,6 @@ crate-type = ["cdylib", "lib"]
name = "boa"
bench = false

[[bench]]
name = "lexer"
harness = false

[[bench]]
name = "parser"
harness = false
Expand All @@ -57,4 +53,4 @@ harness = false

[[bench]]
name = "full"
harness = false
harness = false
Loading