fix(frontend): lex << as two Less tokens to support nested generics#11555
fix(frontend): lex << as two Less tokens to support nested generics#11555TomAFrench merged 4 commits intomasterfrom
<< as two Less tokens to support nested generics#11555Conversation
The lexer previously combined `<<` into a single `ShiftLeft` token, which caused `Store<<T as HasKey>::Key>` to fail parsing since the type parser expected `Token::Less`. This applies the same fix already used for `>>`: always emit two separate tokens and reconstruct the shift operator in the expression parser. Closes #11553
|
This follows the pattern set out in #1319 for |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Brillig Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: a59043a | Previous: c32d7a4 | Ratio |
|---|---|---|---|
rollup-tx-merge |
0.002 s |
0.001 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: e274fb1 | Previous: 2db78f8 | Ratio |
|---|---|---|---|
test_report_zkpassport_noir-ecdsa_ |
3 s |
2 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'ACVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 3d72807 | Previous: 33ebdad | Ratio |
|---|---|---|---|
perfectly_parallel_batch_inversion_opcodes |
3144832 ns/iter (± 15332) |
2201746 ns/iter (± 1256) |
1.43 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 3d72807 | Previous: 33ebdad | Ratio |
|---|---|---|---|
rollup-checkpoint-root |
385 s |
290 s |
1.33 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: d0b7bc0 | Previous: 2db78f8 | Ratio |
|---|---|---|---|
rollup-tx-merge |
0.003 s |
0.002 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
Summary
<<into a singleShiftLefttoken; emit twoLesstokens instead (mirrors the existing>>fix)<<from two<tokens in the expression parser'sparse_shift<<=(now lexed as< <=) innext_is_op_assignand guardparse_less_or_greateragainst itShiftLeftas a 2-token operator (likeShiftRight)Closes 11553Not going to close the issue as there are typechecking errors afterwards and this PR had to simplify the testCloses #11553
Closes #11549
Test plan
nested_angle_brackets_in_type_positionpassesnoirc_frontendtests passnargo_fmttests pass