Skip to content

Commit 03f7d5e

Browse files
committed
More fixes for resumable parser
1 parent cdff95e commit 03f7d5e

File tree

485 files changed

+9363
-14949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

485 files changed

+9363
-14949
lines changed

src/fmt/fmt2.zig

Lines changed: 280 additions & 400 deletions
Large diffs are not rendered by default.

src/parse/AST2.zig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,16 @@ pub const Diagnostic = struct {
603603
// Expression errors
604604
expr_unexpected_token,
605605
expr_no_space_dot_int,
606+
state_not_implemented,
606607
no_else,
607608
expected_expr_bar,
608609
backslash_not_valid_lambda_syntax,
610+
obsolete_interface_keyword,
609611
expected_expr_close_curly_or_comma,
610612
expected_expr_close_round_or_comma,
611613
expected_expr_close_square_or_comma,
612614
expected_close_curly_at_end_of_match,
615+
expected_close_round,
613616
expected_open_curly_after_match,
614617
expected_expr_record_field_name,
615618
expected_expr_apply_close_round,
@@ -789,6 +792,7 @@ pub fn parseDiagnosticToReport(self: *const @This(), env: *const CommonEnv, diag
789792
.expected_exposes => "EXPECTED EXPOSES",
790793
.pattern_unexpected_token => "UNEXPECTED TOKEN IN PATTERN",
791794
.expr_unexpected_token => "UNEXPECTED TOKEN IN EXPRESSION",
795+
.state_not_implemented => "PARSER STATE NOT IMPLEMENTED",
792796
.string_unexpected_token => "UNEXPECTED TOKEN IN STRING",
793797
.ty_anno_unexpected_token => "UNEXPECTED TOKEN IN TYPE ANNOTATION",
794798
.statement_unexpected_token => "UNEXPECTED TOKEN",
@@ -867,6 +871,13 @@ pub fn parseDiagnosticToReport(self: *const @This(), env: *const CommonEnv, diag
867871
try report.document.addLineBreak();
868872
try report.document.addReflowingText("This could be a missing operator, incorrect syntax, or a token in the wrong place.");
869873
},
874+
.state_not_implemented => {
875+
try report.document.addText("Parser encountered an unimplemented state.");
876+
try report.document.addLineBreak();
877+
try report.document.addReflowingText("This is a limitation in the current parser implementation. The feature you're trying to use may not be fully implemented yet.");
878+
try report.document.addLineBreak();
879+
try report.document.addReflowingText("Please report this issue with your code example to help improve the parser.");
880+
},
870881
else => {
871882
// Generic parse error message
872883
try report.document.addText("A parsing error occurred: ");

0 commit comments

Comments
 (0)