Update grammars (#200730)

This commit is contained in:
Alex Ross
2023-12-13 12:08:01 +00:00
committed by GitHub
parent b7fcbef3e2
commit 3c86ede5f5
22 changed files with 543 additions and 916 deletions

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/JuliaEditorSupport/atom-language-julia/commit/85cf3ef2ddcb7bc9b2b17b2a5f1fc664e1f1e718",
"version": "https://github.com/JuliaEditorSupport/atom-language-julia/commit/8747e069119b24bff2703374d7961e3446a74034",
"name": "Julia",
"scopeName": "source.julia",
"comment": "This grammar is used by Atom (Oniguruma), GitHub (PCRE), and VSCode (Oniguruma),\nso all regexps must be compatible with both engines.\n\nSpecs:\n- https://github.com/kkos/oniguruma/blob/master/doc/RE\n- https://www.pcre.org/current/doc/html/",
@@ -30,6 +30,9 @@
{
"include": "#function_call"
},
{
"include": "#for_block"
},
{
"include": "#keyword"
},
@@ -76,11 +79,7 @@
"name": "constant.numeric.julia"
},
{
"match": "\\bfor\\b",
"name": "keyword.control.julia"
},
{
"include": "$self"
"include": "#self_no_for_block"
}
]
}
@@ -106,7 +105,7 @@
},
"patterns": [
{
"include": "$self"
"include": "#self_no_for_block"
}
]
}
@@ -115,8 +114,26 @@
"bracket": {
"patterns": [
{
"match": "(?:\\(|\\)|\\[|\\]|\\{|\\}|,|;)(?!('|(?:\\.'))*\\.?')",
"name": "meta.bracket.julia"
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "meta.bracket.julia"
}
},
"end": "(\\})((?:\\.)?'*)",
"endCaptures": {
"1": {
"name": "meta.bracket.julia"
},
"2": {
"name": "keyword.operator.transpose.julia"
}
},
"patterns": [
{
"include": "#self_no_for_block"
}
]
}
]
},
@@ -215,11 +232,7 @@
},
"patterns": [
{
"match": "\\bfor\\b",
"name": "keyword.control.julia"
},
{
"include": "$self"
"include": "#self_no_for_block"
}
]
}
@@ -259,14 +272,10 @@
}
]
},
"keyword": {
"for_block": {
"comment": "for blocks need to be special-cased to support tokenizing 'outer' properly",
"patterns": [
{
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|module|baremodule|where)\\b",
"name": "keyword.other.julia"
},
{
"comment": "special case for blocks to support tokenizing outer properly",
"begin": "\\b(for)\\b",
"beginCaptures": {
"0": {
@@ -283,9 +292,17 @@
"include": "$self"
}
]
}
]
},
"keyword": {
"patterns": [
{
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|module|baremodule|where)\\b",
"name": "keyword.other.julia"
},
{
"match": "\\b(?<![:_])(?:if|else|elseif|while|begin|let|do|try|catch|finally|return|break|continue)\\b",
"match": "\\b(?<![:_])(?:if|else|elseif|for|while|begin|let|do|try|catch|finally|return|break|continue)\\b",
"name": "keyword.control.julia"
},
{
@@ -608,7 +625,12 @@
"0": {
"name": "punctuation.definition.string.end.julia"
}
}
},
"patterns": [
{
"include": "#string_escaped_char"
}
]
},
{
"begin": "(raw)(\")",
@@ -626,7 +648,12 @@
"0": {
"name": "punctuation.definition.string.end.julia"
}
}
},
"patterns": [
{
"include": "#string_escaped_char"
}
]
},
{
"begin": "(sql)(\"\"\")",
@@ -658,12 +685,22 @@
{
"begin": "var\"\"\"",
"end": "\"\"\"",
"name": "constant.other.symbol.julia"
"name": "constant.other.symbol.julia",
"patterns": [
{
"include": "#string_escaped_char"
}
]
},
{
"begin": "var\"",
"end": "\"",
"name": "constant.other.symbol.julia"
"name": "constant.other.symbol.julia",
"patterns": [
{
"include": "#string_escaped_char"
}
]
},
{
"begin": "^\\s?(doc)?(\"\"\")\\s?$",
@@ -931,24 +968,27 @@
"string_dollar_sign_interpolate": {
"patterns": [
{
"match": "\\$(?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[-‷⁗]|[^\\P{So}←-⇿])*",
"match": "\\$(?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿]|[^\\p{^Sc}$])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[-‷⁗]|[^\\P{So}←-⇿]|[^\\p{^Sc}$])*",
"name": "variable.interpolation.julia"
},
{
"begin": "\\$\\(",
"begin": "\\$(\\()",
"beginCaptures": {
"1": {
"name": "meta.bracket.julia"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "meta.bracket.julia"
}
},
"name": "variable.interpolation.julia",
"comment": "`punctuation.section.embedded`, `constant.escape`,\n& `meta.embedded.line` were considered but appear to have even spottier\nsupport among popular syntaxes.",
"patterns": [
{
"match": "\\bfor\\b",
"name": "keyword.control.julia"
},
{
"include": "#parentheses"
},
{
"include": "$self"
"include": "#self_no_for_block"
}
]
}
@@ -981,6 +1021,47 @@
"name": "meta.type.julia"
}
]
},
"self_no_for_block": {
"comment": "Same as $self, but does not contain #for_block. 'outer' is not valid in some contexts (e.g. generators, comprehensions, indexing), so use this when matching those in begin/end patterns. Keep this up-to-date with $self!",
"patterns": [
{
"include": "#operator"
},
{
"include": "#array"
},
{
"include": "#string"
},
{
"include": "#parentheses"
},
{
"include": "#bracket"
},
{
"include": "#function_decl"
},
{
"include": "#function_call"
},
{
"include": "#keyword"
},
{
"include": "#number"
},
{
"include": "#comment"
},
{
"include": "#type_decl"
},
{
"include": "#symbol"
}
]
}
}
}