Skip to content

Commit

Permalink
Add support to new import statement
Browse files Browse the repository at this point in the history
  • Loading branch information
vinzbarbuto committed Sep 12, 2024
1 parent ef4da34 commit 3deb853
Showing 1 changed file with 89 additions and 47 deletions.
136 changes: 89 additions & 47 deletions syntaxes/lflang.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,19 @@
},
"c-target": {
"begin": "(?=\\btarget\\s+C\\b)",
"patterns": [{
"include": "#c-or-cpp-target"
}]
"patterns": [
{
"include": "#c-or-cpp-target"
}
]
},
"cpp-target": {
"begin": "(?=\\btarget\\s+C?Cpp\\b)",
"patterns": [{
"include": "#c-or-cpp-target"
}]
"patterns": [
{
"include": "#c-or-cpp-target"
}
]
},
"c-or-cpp-target": {
"patterns": [
Expand Down Expand Up @@ -181,9 +185,11 @@
"begin": "\\{=",
"end": "(([<>]?[<>+\\-*/%&\\^|]?=\\}))",
"name": "meta.embedded.block.cpp",
"patterns": [{
"include": "source.cpp"
}]
"patterns": [
{
"include": "source.cpp"
}
]
}
]
},
Expand All @@ -197,9 +203,11 @@
"begin": "\\{=(?!=\\})",
"end": "([<>]?[<>+\\-*/%&\\^|]?=\\})",
"name": "meta.embedded.block.ts",
"patterns": [{
"include": "source.ts"
}]
"patterns": [
{
"include": "source.ts"
}
]
}
]
},
Expand All @@ -217,10 +225,12 @@
{
"begin": "\\b(?=import\\b)",
"end": "(?==\\})",
"patterns": [{
"name": "keyword.control.import.python",
"match": "\\b(import|as)\\b"
}]
"patterns": [
{
"name": "keyword.control.import.python",
"match": "\\b(import|as)\\b"
}
]
},
{
"include": "source.python"
Expand All @@ -239,9 +249,11 @@
"begin": "\\{=(?!=\\})",
"end": "([<>]?[<>+\\-*/%&\\^|]?=\\})",
"name": "meta.embedded.block.rs",
"patterns": [{
"include": "source.rust"
}]
"patterns": [
{
"include": "source.rust"
}
]
}
]
},
Expand Down Expand Up @@ -269,7 +281,7 @@
},
"import-statement": {
"begin": "(?=^\\s*import\\b)",
"end": ";|(?<=\")\\s*$",
"end": ";|(?<=\")\\s*$|(?<=>)\\s*$",
"patterns": [
{
"include": "#context-insensitive"
Expand All @@ -287,6 +299,20 @@
"match": "\\b\\w+\\b"
}
]
},
{
"begin": "(?<=from)\\s*(\"|<)",
"end": "(\"|>)",
"patterns": [
{
"name": "string.quoted.double.lflang",
"match": "(?<=\").*?(?=\")"
},
{
"name": "string.quoted.angle.lflang",
"match": "(?<=<).*?(?=>)"
}
]
}
]
},
Expand Down Expand Up @@ -401,21 +427,27 @@
]
},
"nested-member-id": {
"patterns": [{
"begin": "(?<=(\\binput\\b |\\boutput\\b|\\baction\\b|\\bstate\\b ))",
"end": "(?=[:\\(\\{;=\\n])",
"patterns": [{
"name": "variable.other.lflang",
"match": "\\b(\\w+)\\b"
}]
}]
"patterns": [
{
"begin": "(?<=(\\binput\\b |\\boutput\\b|\\baction\\b|\\bstate\\b ))",
"end": "(?=[:\\(\\{;=\\n])",
"patterns": [
{
"name": "variable.other.lflang",
"match": "\\b(\\w+)\\b"
}
]
}
]
},
"nested-member-type": {
"begin": "(?<=:)",
"end": "(?=[\\(\\{;=\\n])",
"patterns": [{
"include": "#type"
}]
"patterns": [
{
"include": "#type"
}
]
},
"type": {
"patterns": [
Expand Down Expand Up @@ -447,33 +479,41 @@
"name": "string.quoted.triple.lflang",
"begin": "'''",
"end": "'''",
"patterns": [{
"include": "#string-helper"
}]
"patterns": [
{
"include": "#string-helper"
}
]
},
{
"name": "string.quoted.triple.lflang",
"begin": "\"\"\"",
"end": "\"\"\"",
"patterns": [{
"include": "#string-helper"
}]
"patterns": [
{
"include": "#string-helper"
}
]
},
{
"name": "string.quoted.double.lflang",
"begin": "\"",
"end": "(\"|$)",
"patterns": [{
"include": "#string-helper"
}]
"patterns": [
{
"include": "#string-helper"
}
]
},
{
"name": "string.quoted.single.lflang",
"begin": "'",
"end": "('|$)",
"patterns": [{
"include": "#string-helper"
}]
"patterns": [
{
"include": "#string-helper"
}
]
}
]
},
Expand Down Expand Up @@ -522,9 +562,11 @@
{
"begin": "(?<=\\s*=\\s*new\\s*(\\[[^\\]]*\\])?\\s+\\w+\\s*)<",
"end": ">",
"patterns": [{
"include": "#type"
}]
"patterns": [
{
"include": "#type"
}
]
}
]
},
Expand Down Expand Up @@ -555,4 +597,4 @@
}
],
"uuid": "cd57a55d-0af5-4750-a6a0-3b7108553c2a"
}
}

0 comments on commit 3deb853

Please sign in to comment.