Commit graph

6 commits

Author SHA1 Message Date
Dennis
7fb4d613af
Use errorSupplemental for long errors with 2 sentences (#21060) 2025-03-23 06:03:20 +08:00
Dennis
9f33f031f0
Rephrase "no identifier for declarator" parse error (#20872) 2025-02-16 08:09:43 +08:00
Dennis
d55d183e4a
Fix tests after failed merge (#15432) 2023-07-19 18:14:34 +02:00
Nick Treleaven
59817ef96c
[dmd/parse] Refactor enum declaration (#15397)
* [dmd/parse] Refactor enum declaration

Tip: set ignore whitespace for diff.

Remove prevTOK.
Only use token loop for attributes.
"expected identifier after type" introduced in previous pull replaced
with "no identifier for declarator" for consistency.
Non-@ token "not a valid attribute" error replaced with "expected identifier".
"type only allowed if anonymous enum and no enum type" error was never
hit, this triggered "not a valid attribute" error instead.
No need to check `terror` as type will be null anyway.
"assignment must be preceded by an identifier" has been superceded by
other errors.
Make "enum declaration is invalid" error more informative.

* Add test for lone attribute

* Detect typed member with named enum for better error

* Add test for type error

* Avoid infinite loop

* Move 2 new tests to separate file; test `T @a b`
2023-07-19 13:01:40 +03:00
Nick Treleaven
44f36f47a6 [parse.d] Show token when expecting semicolon 2023-05-05 06:38:56 +08:00
Iain Buclaw
6374bb87b7 Move dmd files into compiler/ 2022-07-09 18:53:07 +02:00
Renamed from test/fail_compilation/failcontracts.d (Browse further)