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

Remove backticks around suggested fixes for parser errors #3046

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions runtime/parser/declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func parseDeclaration(p *parser, docString string) (ast.Declaration, error) {
func handlePriv(p *parser) {
p.report(p.syntaxErrorWithSuggestedFix(
"`priv` is no longer a valid access keyword",
"`access(self)`",
"access(self)",
))
p.next()
}
Expand All @@ -298,7 +298,7 @@ func handlePub(p *parser) error {
p.report(NewSyntaxErrorWithSuggestedReplacement(
pubToken.Range,
"`pub` is no longer a valid access keyword",
"`access(all)`",
"access(all)",
))
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/parser/declaration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9664,7 +9664,7 @@ func TestParseDeprecatedAccessModifiers(t *testing.T) {
StartPos: ast.Position{Offset: 1, Line: 1, Column: 1},
EndPos: ast.Position{Offset: 3, Line: 1, Column: 3},
},
SuggestedFix: "`access(all)`",
SuggestedFix: "access(all)",
},
},
errs,
Expand All @@ -9685,7 +9685,7 @@ func TestParseDeprecatedAccessModifiers(t *testing.T) {
StartPos: ast.Position{Offset: 1, Line: 1, Column: 1},
EndPos: ast.Position{Offset: 4, Line: 1, Column: 4},
},
SuggestedFix: "`access(self)`",
SuggestedFix: "access(self)",
},
},
errs,
Expand Down
Loading