Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

go.mod: allow no space before comment, do not allow double slash in unqouted string #2424

Merged
merged 1 commit into from
Jun 5, 2019
Merged
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
16 changes: 12 additions & 4 deletions syntaxes/go.mod.tmGrammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
},
{
"include": "#directive"
},
{
"include": "#invalid"
}
],
"repository": {
"directive": {
"patterns": [
{
"comment": "Multi-Line directive",
"begin": "(\\w+)\\s+\\(",
"begin": "(\\w+)\\s*\\(",
"beginCaptures": {
"1": {
"name": "keyword.go.mod"
Expand All @@ -28,7 +31,7 @@
},
{
"comment": "Single-Line directive",
"match": "(\\w+)\\s+(.*)",
"match": "(\\w+)\\s*(.*)",
"captures": {
"1": {
"name": "keyword.go.mod"
Expand Down Expand Up @@ -86,7 +89,7 @@
},
"unquoted_string": {
"comment": "Unquoted string",
"match": "[^\\s]+",
"match": "([^\\s/]|/(?!/))+",
"name": "string.unquoted.go.mod"
},
"double_quoted_string": {
Expand Down Expand Up @@ -158,6 +161,11 @@
"name": "constant.other.placeholder.go.mod"
}
]
},
"invalid": {
"comment": "invalid",
"match": ".*",
"name": "invalid.illegal.unknown.go.mod"
}
}
}
}