Skip to content

Commit

Permalink
Including some valid chars into words.
Browse files Browse the repository at this point in the history
Included HAS detection in the function-definition
  • Loading branch information
Oldes committed May 19, 2014
1 parent 087f85e commit 5e78cc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions Red.JSON-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -376,21 +376,22 @@
"word-setword": {
"name": "support.variable.setword.red",
"match": "[^:\\s\\n\\[\\]\\(\\)]*:"
//note: values like [ foo:boo ] are catched as valid url! in REBOL, so keeping this functionality there as well.
},

"word-getword": {
"name": "support.variable.getword.red",
"match": "(?<=^|\\s|\\[|\\]|\\)|\\():[A-Za-z_0-9\\*\\?=_-]+(?=\\s|\\)|\\])"
"match": "(?<=^|\\s|\\[|\\]|\\)|\\():[A-Za-z_0-9=_\\-\\!\\?\\*\\+\\.~:']+(?=\\s|\\)|\\])"
},

"word-litword": {
"name": "keyword.litword.red",
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()'[A-Za-z_0-9\\*\\?=_-]+(?=\\s|\\)|\\])"
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()'[A-Za-z_0-9=_\\-\\!\\?\\*\\+\\.~:']+(?=\\s|\\)|\\])"
},

"word-datatype": {
"name": "support.type.red",
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()([A-Za-z_0-9\\-_\\*\\?]+\\!|as)(?=\\s|\\)|\\])"
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()([A-Za-z_0-9=_\\-\\?\\*\\+\\.~:']+\\!|as)(?=\\s|\\)|\\])"
},

"word-group1": {
Expand Down Expand Up @@ -426,7 +427,7 @@
//WORD is defined here so numbers are not detected inside words like: foo-2-boo
"word": {
"name": "word.red",
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()[A-Za-z_\\*\\?=_-]+[A-Za-z_0-9\\*\\?=_-]*(?=\\s|\\)|\\]|/|;|\\\"|{)"
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()[A-Za-z_\\*\\?=_-]+[A-Za-z_0-9=_\\-\\!\\?\\*\\+\\.~:']*(?=\\s|\\)|\\]|/|;|\\\"|{)"
},

"function-definition-block": {
Expand All @@ -441,7 +442,7 @@

"function-definition": {
"name": "function.definition",
"begin": "([A-Za-z=\\!\\?\\*_\\+][A-Za-z0-9=_\\-\\!\\?\\*\\+\\.]*):\\s+(?i)(function|func|funct|routine)\\s*(\\[)",
"begin": "([A-Za-z=\\!\\?\\*_\\+][A-Za-z0-9=_\\-\\!\\?\\*\\+\\.~']*):\\s+(?i)(function|func|funct|routine|has)\\s*(\\[)",
"beginCaptures": {
"1": {"name": "support.variable.function.red"},
"2": {"name": "keyword.function"},
Expand Down
12 changes: 6 additions & 6 deletions Red.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
<key>function-definition</key>
<dict>
<key>begin</key>
<string>([A-Za-z=\!\?\*_\+][A-Za-z0-9=_\-\!\?\*\+\.]*):\s+(?i)(function|func|funct|routine)\s*(\[)</string>
<string>([A-Za-z=\!\?\*_\+][A-Za-z0-9=_\-\!\?\*\+\.~']*):\s+(?i)(function|func|funct|routine|has)\s*(\[)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down Expand Up @@ -841,21 +841,21 @@
<key>word</key>
<dict>
<key>match</key>
<string>(?&lt;=^|\s|\[|\]|\)|\()[A-Za-z_\*\?=_-]+[A-Za-z_0-9\*\?=_-]*(?=\s|\)|\]|/|;|\"|{)</string>
<string>(?&lt;=^|\s|\[|\]|\)|\()[A-Za-z_\*\?=_-]+[A-Za-z_0-9=_\-\!\?\*\+\.~:']*(?=\s|\)|\]|/|;|\"|{)</string>
<key>name</key>
<string>word.red</string>
</dict>
<key>word-datatype</key>
<dict>
<key>match</key>
<string>(?&lt;=^|\s|\[|\]|\)|\()([A-Za-z_0-9\-_\*\?]+\!|as)(?=\s|\)|\])</string>
<string>(?&lt;=^|\s|\[|\]|\)|\()([A-Za-z_0-9=_\-\?\*\+\.~:']+\!|as)(?=\s|\)|\])</string>
<key>name</key>
<string>support.type.red</string>
</dict>
<key>word-getword</key>
<dict>
<key>match</key>
<string>(?&lt;=^|\s|\[|\]|\)|\():[A-Za-z_0-9\*\?=_-]+(?=\s|\)|\])</string>
<string>(?&lt;=^|\s|\[|\]|\)|\():[A-Za-z_0-9=_\-\!\?\*\+\.~:']+(?=\s|\)|\])</string>
<key>name</key>
<string>support.variable.getword.red</string>
</dict>
Expand Down Expand Up @@ -897,7 +897,7 @@
<key>word-litword</key>
<dict>
<key>match</key>
<string>(?&lt;=^|\s|\[|\]|\)|\()'[A-Za-z_0-9\*\?=_-]+(?=\s|\)|\])</string>
<string>(?&lt;=^|\s|\[|\]|\)|\()'[A-Za-z_0-9=_\-\!\?\*\+\.~:']+(?=\s|\)|\])</string>
<key>name</key>
<string>keyword.litword.red</string>
</dict>
Expand Down Expand Up @@ -925,7 +925,7 @@
<key>word-setword</key>
<dict>
<key>match</key>
<string>[^:\s\n\[\]\(\)]*:</string>
<string>[^:\s\n\[\]\(\)]*:(?=\s|\(|\[|\)|\]|;|\"|{)</string>
<key>name</key>
<string>support.variable.setword.red</string>
</dict>
Expand Down

0 comments on commit 5e78cc2

Please sign in to comment.