From f1448192d75678b67a447fb53d5450a2adf482a1 Mon Sep 17 00:00:00 2001 From: Luca Vazzano Date: Tue, 11 Oct 2016 00:11:42 +0200 Subject: [PATCH] updated syntax definition for SetlX v2.5.0 (including BREAKING changes) - the syntax definition for Terms was adapted to the changes made in SetlX v2.5.0 - some parts of the syntax definition were moved around and reorganized to hopefully provide a more reliable system --- SetlX.YAML-tmLanguage | 51 ++++++------------- SetlX.tmLanguage | 112 ++++++++++-------------------------------- messages.json | 3 +- messages/1-2-0.txt | 4 ++ 4 files changed, 47 insertions(+), 123 deletions(-) create mode 100644 messages/1-2-0.txt diff --git a/SetlX.YAML-tmLanguage b/SetlX.YAML-tmLanguage index 1f14da0..de12b80 100644 --- a/SetlX.YAML-tmLanguage +++ b/SetlX.YAML-tmLanguage @@ -9,10 +9,8 @@ uuid: 8be6972f-85b1-4d39-b3b5-68bbfdb44d84 patterns: - include: '#statements' - include: '#fucntions' -- include: '#values' - include: '#keywords' -- name: meta.variable.setlx - match: ([a-z]\w*) +- include: '#values' repository: @@ -104,14 +102,13 @@ repository: match: ((continue)|(break)) for: name: meta.for.setlx - begin: (for) + begin: (for ) beginCaptures: '1': {name: keyword.control.setlx} patterns: - name: meta.for.iterators.setlx begin: (\() patterns: - - include: '#iterator-chain' - name: keyword.operator.setlx match: (\|) end: (\)\s*\{) @@ -208,20 +205,16 @@ repository: - include: '#scan' match: name: meta.match.setlx - begin: (match) + begin: (match)(\s*\(.*\))\s*(\{) beginCaptures: '1': {name: keyword.control.setlx} patterns: - - begin: (\() - name: meta.match.expression.setlx - patterns: - - include: '$self' - end: (\)\s*\{) - name: meta.match.case.setlx begin: (case) beginCaptures: '1': {name: keyword.control.setlx} patterns: + - include: '$self' - name: keyword.control.setlx match: (\|) end: (\:) @@ -229,7 +222,7 @@ repository: '1': {name: keyword.control.setlx} - include: '#regex-branch' - name: keyword.control.setlx - match: (default\s*\:) + match: ((default)(\s)*(\:)) - include: '$self' end: (\}) scan: @@ -374,12 +367,10 @@ repository: patterns: - name: keyword.operator.setlx match: (\:) - - include: '#iterator-chain' - name: meta.collection.conditions.setlx patterns: - name: keyword.operator.setlx match: (\|) - - include: '#iterator-chain' lin-alg: patterns: @@ -466,7 +457,7 @@ repository: - name: keyword.operator.product.setlx match: (\*) - name: keyword.operator.product.setlx - match: (/) + match: (/)(?!/|\*) - name: keyword.operator.product.setlx match: (\\) - name: keyword.operator.product.setlx @@ -487,8 +478,6 @@ repository: match: (\-) - name: keyword.operator.prefix.setlx match: (\+) - - name: keyword.operator.prefix.setlx - match: (\@) exists: name: keyword.operator.setlx match: (exists) @@ -498,14 +487,6 @@ repository: negator: name: keyword.operator.setlx match: (\!) - iterator-chain: - name: meta.iteratorchain.setlx - patterns: - - include: '#iterator-marker' - - match: \, - iterator-marker: # a in x - name: keyword.operator.setlx - match: (in( \s)+) range-sign: # .. name: keyword.operator.setlx match: (\.\.) @@ -516,6 +497,7 @@ repository: patterns: - include: '#atomic-languageConstant' - include: '#atomic-functionSymbol' + - include: '#atomic-variable-name' - include: '#atomic-number' - include: '#atomic-double' - include: '#atomic-string' @@ -542,22 +524,19 @@ repository: atomic-functionSymbol: comment: combination of all three ways to defina a functionSymbol for a term patterns: - - include: '#atomic-functionSymbol-capital' - include: '#atomic-functionSymbol-escaped' - include: '#atomic-functionSymbol-internal' - atomic-functionSymbol-capital: - comment: atomic value, functionSymbol for a term, written with an initial capital letter - name: entity.functionSymbol.setlx - match: ([A-Z])([a-zA-Z0-9]|_)* atomic-functionSymbol-escaped: - comment: atomic value, functionSymbol for a term, written with an initial @ as escape-character - # used internally for definitions - name: entity.functionSymbol.setlx - match: ((@)([a-z]))([a-zA-Z0-9]|_)* + comment: atomic value, functionSymbol for a term, used by the user to define a custom Term + name: entity.functionSymbol.escaped.setlx + match: ((@[a-zA-Z])([a-zA-Z0-9]|_)+) atomic-functionSymbol-internal: comment: atomic value, functionSymbol for a term, used internally for definitions - name: entity.functionSymbol.setlx - match: (\^)([a-zA-Z0-9]|_)* + name: entity.functionSymbol.internal.setlx + match: ((@@@[a-zA-Z])([a-zA-Z0-9]|_)+) + atomic-variable-name: + name: meta.variable.setlx + match: (([a-zA-Z])([a-zA-Z0-9]|_)+) atomic-number: comment: combination of all ways to define a nuber patterns: diff --git a/SetlX.tmLanguage b/SetlX.tmLanguage index 98b1048..7fc37a0 100644 --- a/SetlX.tmLanguage +++ b/SetlX.tmLanguage @@ -19,19 +19,13 @@ include #fucntions - - include - #values - include #keywords - match - ([a-z]\w*) - name - meta.variable.setlx + include + #values repository @@ -170,10 +164,6 @@ combination of all three ways to defina a functionSymbol for a term patterns - - include - #atomic-functionSymbol-capital - include #atomic-functionSymbol-escaped @@ -184,32 +174,23 @@ - atomic-functionSymbol-capital - - comment - atomic value, functionSymbol for a term, written with an initial capital letter - match - ([A-Z])([a-zA-Z0-9]|_)* - name - entity.functionSymbol.setlx - atomic-functionSymbol-escaped comment - atomic value, functionSymbol for a term, written with an initial @ as escape-character + atomic value, functionSymbol for a term, used by the user to define a custom Term match - ((@)([a-z]))([a-zA-Z0-9]|_)* + ((@[a-zA-Z])([a-zA-Z0-9]|_)+) name - entity.functionSymbol.setlx + entity.functionSymbol.escaped.setlx atomic-functionSymbol-internal comment atomic value, functionSymbol for a term, used internally for definitions match - (\^)([a-zA-Z0-9]|_)* + ((@@@[a-zA-Z])([a-zA-Z0-9]|_)+) name - entity.functionSymbol.setlx + entity.functionSymbol.internal.setlx atomic-int @@ -351,6 +332,13 @@ name constant.language.setlx + atomic-variable-name + + match + (([a-zA-Z])([a-zA-Z0-9]|_)+) + name + meta.variable.setlx + atomics comment @@ -367,6 +355,10 @@ include #atomic-functionSymbol + + include + #atomic-variable-name + include #atomic-number @@ -800,7 +792,7 @@ for begin - (for) + (for ) beginCaptures 1 @@ -824,10 +816,6 @@ meta.for.iterators.setlx patterns - - include - #iterator-chain - match (\|) @@ -924,10 +912,6 @@ name keyword.operator.setlx - - include - #iterator-chain - @@ -941,10 +925,6 @@ name keyword.operator.setlx - - include - #iterator-chain - @@ -993,29 +973,6 @@ - iterator-chain - - name - meta.iteratorchain.setlx - patterns - - - include - #iterator-marker - - - match - \, - - - - iterator-marker - - match - (in( \s)+) - name - keyword.operator.setlx - keywords comment @@ -1195,7 +1152,7 @@ match begin - (match) + (match)(\s*\(.*\))\s*(\{) beginCaptures 1 @@ -1210,21 +1167,6 @@ meta.match.setlx patterns - - begin - (\() - end - (\)\s*\{) - name - meta.match.expression.setlx - patterns - - - include - $self - - - begin (case) @@ -1250,6 +1192,10 @@ meta.match.case.setlx patterns + + include + $self + match (\|) @@ -1264,7 +1210,7 @@ match - (default\s*\:) + ((default)(\s)*(\:)) name keyword.control.setlx @@ -1335,12 +1281,6 @@ name keyword.operator.prefix.setlx - - match - (\@) - name - keyword.operator.prefix.setlx - procedure @@ -1383,7 +1323,7 @@ match - (/) + (/)(?!/|\*) name keyword.operator.product.setlx diff --git a/messages.json b/messages.json index 7e5496d..ae7e744 100644 --- a/messages.json +++ b/messages.json @@ -2,5 +2,6 @@ "install": "messages/install.txt", "1.1.0": "messages/1-1-0.txt", "1.1.1": "messages/1-1-1.txt", - "1.1.2": "messages/1-1-2.txt" + "1.1.2": "messages/1-1-2.txt", + "1.2.0": "messages/1-2-0.txt" } \ No newline at end of file diff --git a/messages/1-2-0.txt b/messages/1-2-0.txt new file mode 100644 index 0000000..a371a68 --- /dev/null +++ b/messages/1-2-0.txt @@ -0,0 +1,4 @@ +FIXES: + - the syntax definition for Terms was adapted to the changes made in SetlX v2.5.0 + - some parts of the syntax definition were moved around and reorganized to hopefully provide a more reliable system + - removed the directory for the VS Code-Version of this extension out of the master branch to avoid interference \ No newline at end of file