-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Go] Fix compiler directive syntax patterns (#3242)
This adds line and export directive syntax patterns and generalises the `//go:name` pattern for use in other contexts such as linter directives. It also fixes `//go:name` matching to avoid matching invalid directive comments. These should be marked as valid directives: ``` //go:linkname //go:cgo_import_dynamic //lint:ignore U1000 This is here for user documentation. //lint:ignore-file Autogenerated. //line file.rl:3732:45 //line :3732:45:45 //line :3732 :45:45 /*line file.rl:3732:45*/ /*line :3732:45:45*/ /*line :3732 :45:45*/ //export myfunc //extern myfunc ``` These should not be marked: ``` /*line file.rl:3732:45 */ /*line :3732:45:45 */ /*line :3732 :45:45 */ //go: //go ``` Co-authored-by: DeathAxe <[email protected]>
- Loading branch information
Showing
2 changed files
with
167 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters