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

Implement the legalizer #438

Merged
merged 70 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
8b3b7d7
PR #437
mcy Jan 29, 2025
c6e445e
add Span.Len
mcy Jan 29, 2025
5a0be56
add new iterator helpers
mcy Jan 29, 2025
5c50385
add classifier methods for predeclared.Name
mcy Jan 29, 2025
c9309db
add an enum for syntax/edition values
mcy Jan 29, 2025
8dd79ae
add some new taxa.Nouns
mcy Jan 29, 2025
f40ec3c
ast additions
mcy Jan 29, 2025
453be0c
fix brackets not being recorded for compact options
mcy Jan 29, 2025
79bf0e0
update import parsing to catch more nested imports
mcy Jan 29, 2025
a469395
track if we're in edition mode
mcy Jan 29, 2025
2893908
add diagnostics for use in the legalizer
mcy Jan 29, 2025
e56474d
add new testdata files for use with the legalizer
mcy Jan 29, 2025
198a8bc
skeletonize the legalizer
mcy Jan 29, 2025
4c4129e
legalize syntax
mcy Jan 29, 2025
02ac466
legalize package
mcy Jan 29, 2025
96efead
legalize imports
mcy Jan 29, 2025
8603323
legalize against bare braces
mcy Jan 29, 2025
ce87eb6
legalize ranges
mcy Jan 29, 2025
e138256
legalize parent relationships for defs
mcy Jan 29, 2025
35f4923
legalize messages and friends
mcy Jan 29, 2025
f796024
legalize fields
mcy Jan 29, 2025
0eb82c2
legalize options
mcy Jan 29, 2025
c7f6c7e
legalize methods
mcy Jan 29, 2025
6575e52
legalize types
mcy Jan 29, 2025
6929176
fix zero_test
mcy Jan 30, 2025
fc14e67
lint
mcy Jan 30, 2025
8086d1e
add comments
mcy Jan 30, 2025
119c667
cr for predeclared
mcy Feb 7, 2025
d72c0ad
add tests for the syntax package
mcy Feb 7, 2025
b1be12f
fix group types not being printed
mcy Feb 7, 2025
d74a61b
string helpers
mcy Feb 7, 2025
f3de41d
add span helpers
mcy Feb 7, 2025
dd7fdfb
cr
mcy Feb 7, 2025
f7e68d3
cr
mcy Feb 7, 2025
d94e883
fix a renderer quirk
mcy Feb 7, 2025
ae8f170
Merge remote-tracking branch 'origin/main' into mcy/legalize
mcy Feb 7, 2025
cddd440
lint
mcy Feb 7, 2025
e321aaa
suggestions for reserved names
mcy Feb 10, 2025
e8e6a03
add more context to bad-nest errors
mcy Feb 10, 2025
21f75e5
cr
mcy Feb 10, 2025
ca53838
be more precise about classifying single-element paths
mcy Feb 10, 2025
58ffdca
legalize option values
mcy Feb 11, 2025
da83bd5
improve span for incomplete signatures
mcy Feb 11, 2025
5bdfe90
add more validation for types
mcy Feb 11, 2025
5d3ddb3
move a var
mcy Feb 11, 2025
e3318a4
legalize extn ranges
mcy Feb 11, 2025
2c9bfc9
lint
mcy Feb 11, 2025
b3b3c6b
Bump golang.org/x/tools from 0.29.0 to 0.30.0 in /internal/tools (#440)
dependabot[bot] Feb 10, 2025
308341c
Bump golang.org/x/sync from 0.10.0 to 0.11.0 in /internal/benchmarks …
dependabot[bot] Feb 10, 2025
449dfd8
Bump golang.org/x/sync from 0.10.0 to 0.11.0 (#444)
dependabot[bot] Feb 10, 2025
418a3ac
Bump google.golang.org/protobuf from 1.36.4 to 1.36.5 (#443)
dependabot[bot] Feb 10, 2025
5ea57e4
Fix cursor-at for close tokens (#445)
doriable Feb 11, 2025
8ed3e0a
Set brackets on TypeList in parser (#448)
doriable Feb 12, 2025
901587e
Implement text wrapping for most diagnostic messages (#446)
mcy Feb 12, 2025
75102e7
Fix minor mis-accounting of column position in `report.wordWrap` (#449)
mcy Feb 12, 2025
bbdf2f4
use automatic word wrapping
mcy Feb 12, 2025
709b42c
Merge remote-tracking branch 'origin/main' into mcy/legalize
mcy Feb 25, 2025
a88cee7
cr
mcy Feb 25, 2025
ad19a2b
oops
mcy Feb 26, 2025
3f278e9
Merge remote-tracking branch 'origin/main' into mcy/legalize
mcy Feb 26, 2025
4c5a17c
Merge remote-tracking branch 'origin/main' into mcy/legalize
mcy Feb 27, 2025
3d69f92
unbreak
mcy Feb 27, 2025
294ee4d
unbreak2
mcy Feb 27, 2025
b05b1f3
Merge remote-tracking branch 'origin/main' into mcy/legalize
mcy Feb 27, 2025
3447b40
fix diagnostics broken by merge
mcy Feb 27, 2025
1209df4
lint
mcy Feb 27, 2025
317be10
regen tests
mcy Feb 28, 2025
b585260
Merge remote-tracking branch 'origin/main' into mcy/legalize
mcy Feb 28, 2025
0adf7e5
cr
mcy Feb 28, 2025
bb769e0
facepalm
mcy Feb 28, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@ error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:19:12
|
19 | message foo.Bar {
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a message definition must be a single identifier

error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:20:14
|
20 | oneof foo.Bar {}
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a oneof definition must be a single identifier

error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:21:14
|
21 | oneof foo.(bar.baz).Bar {}
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a oneof definition must be a single identifier

error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:23:12
|
23 | message foo.(bar.baz).Bar {}
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a message definition must be a single identifier

error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:25:9
|
25 | enum foo.Bar {}
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a enum definition must be a single identifier

error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:26:9
|
26 | enum foo.(bar.baz).Bar {}
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a enum definition must be a single identifier

error: unexpected nested extension path in message extension block
Expand All @@ -50,14 +50,14 @@ error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:31:12
|
31 | service foo.Bar {}
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a service definition must be a single identifier

error: unexpected `.` in identifier
--> testdata/parser/def/bad_path.proto:32:12
|
32 | service foo.(bar.baz).Bar {}
| ^ expected identifier
| ^ unexpected `.` in identifier
= note: the name of a service definition must be a single identifier

encountered 9 errors
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ error: missing method return type in service method
--> testdata/parser/method/incomplete.proto:21:13
|
21 | rpc Bar2(foo.Bar);
| ^^^^^^^^^ expected type in `(...)` after this
| ^^^^^^^^^ expected return type in `returns (...)` after this

error: missing method parameter list in service method
--> testdata/parser/method/incomplete.proto:22:9
|
22 | rpc Bar3 returns (foo.Bar);
| ^^^^ expected type in `(...)` after this
| ^^^^ expected argument type in `(...)` after this

error: expected exactly one type in method return type, got 0
--> testdata/parser/method/incomplete.proto:23:31
Expand All @@ -35,10 +35,10 @@ error: expected exactly one type in method parameter list, got 0
| ^^

error: missing method return type in service method
--> testdata/parser/method/incomplete.proto:25:13
--> testdata/parser/method/incomplete.proto:25:16
|
25 | rpc Bar6() returns;
| ^^ expected type in `(...)` after this
| ^^^^^^^ expected return type in `(...)` after this

error: unexpected `;` after `returns`
--> testdata/parser/method/incomplete.proto:25:23
Expand Down
Loading