Better error message
This commit is contained in:
@@ -79,8 +79,8 @@ public sealed class Parser
|
||||
Symbol.Func => ParseFunc(startIndex, exported, null),
|
||||
Symbol.Struct => ParseStruct(startIndex, exported),
|
||||
_ => throw new ParseException(Diagnostic
|
||||
.Error($"Expected 'func' or 'struct' but found '{keyword.Symbol}'")
|
||||
.WithHelp("Valid definition keywords are 'func' and 'struct'")
|
||||
.Error($"Expected 'func', 'struct', 'import' or 'module' but found '{keyword.Symbol}'")
|
||||
.WithHelp("Valid top level statements are 'func', 'struct', 'import' and 'module'")
|
||||
.At(keyword)
|
||||
.Build())
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user