Skip to content

Commit

Permalink
Fixed money! datatype and handling negative numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jun 9, 2014
1 parent caca1fc commit 87d0a68
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
21 changes: 10 additions & 11 deletions Red.JSON-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
{"include": "#comments"},
{"include": "#type-literal"},
{"include": "#strings"},
{"include": "#words"},
{"include": "#values"}

{"include": "#values"},
{"include": "#words"}
],
"repository": {

Expand Down Expand Up @@ -318,7 +317,7 @@

"value-money": {
"name": "number.money.red",
"match": "(?<!\\w)-?[a-zA-Z]*\\$[0-9]+(\\.[0-9]{2})?"
"match": "(?<!\\w)-?[a-zA-Z]*\\$\\d+(\\.\\d*)?"
},

"value-number": {
Expand Down Expand Up @@ -354,7 +353,10 @@
{ "include": "#value-tuple" },
{ "include": "#value-number" },
{ "include": "#value-pair" },
{ "include": "#value-money" }
{ "include": "#value-money" },
{ "include": "#value-number-hex" },
{ "include": "#value-date" },
{ "include": "#value-time" }
]
},

Expand Down Expand Up @@ -391,12 +393,12 @@

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

"word-group1": {
"name": "support.function.red",
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()(?i)(native|alias|all|any|as-string|as-binary|bind|bound\\?|case|catch|checksum|comment|debase|dehex|exclude|difference|disarm|enbase|form|free|get|get-env|in|intersect|minimum-of|maximum-of|mold|new-line|new-line\\?|not|now|prin|print|reduce|compose|construct|reverse|save|script\\?|set|shift|throw|to-hex|trace|try|type\\?|union|charset|unique|unprotect|unset|use|value\\?|compress|decompress|secure|open|close|read|read-io|write-io|write|update|query|wait|input\\?|exp|log-10|log-2|log-e|square-root|cosine|sine|tangent|arccosine|arcsine|arctangent|protect|lowercase|uppercase|entab|detab|connected\\?|browse|launch|stats|get-modes|set-modes|to-local-file|to-rebol-file|encloak|decloak|create-link|do-browser|bind\\?|hide|draw|show|size-text|textinfo|offset-to-caret|caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|crypt-strength\\?|dh-make-key|dh-generate-key|dh-compute-key|dsa-make-key|dsa-generate-key|dsa-make-signature|dsa-verify-signature|rsa-make-key|rsa-generate-key|rsa-encrypt)(?=\\s|\\(|\\[|/|;|\\\"|{)"
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()(?i)(native|alias|all|any|as-string|as-binary|bind|bound\\?|case|catch|checksum|comment|debase|dehex|exclude|difference|disarm|enbase|form|free|get|get-env|in|intersect|minimum-of|maximum-of|mold|new-line|new-line\\?|not|now|prin|print|reduce|compose|construct|reverse|save|script\\?|set|shift|throw|to-hex|trace|try|type\\?|union|charset|unique|unprotect|unset|use|value\\?|compress|decompress|secure|open|close|read|read-io|write-io|write|update|query|wait|input\\?|exp|log-10|log-2|log-e|square-root|cosine|sine|tangent|arccosine|arcsine|arctangent|arctangent2|atan2|protect|lowercase|uppercase|entab|detab|connected\\?|browse|launch|stats|get-modes|set-modes|to-local-file|to-rebol-file|encloak|decloak|create-link|do-browser|bind\\?|hide|draw|show|size-text|textinfo|offset-to-caret|caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|crypt-strength\\?|dh-make-key|dh-generate-key|dh-compute-key|dsa-make-key|dsa-generate-key|dsa-make-signature|dsa-verify-signature|rsa-make-key|rsa-generate-key|rsa-encrypt)(?=\\s|\\(|\\[|/|;|\\\"|{)"
},

"word-group2": {
Expand All @@ -406,7 +408,7 @@

"word-group3": {
"name": "keyword.series.red",
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()(?i)(insert|append|tail|head|back|repend)(?=\\s|\\(|\\[|\\)|\\]|/|;|\\\"|{)"
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()(?i)(at|insert|append|tail|head|back|repend|next)(?=\\s|\\(|\\[|\\)|\\]|/|;|\\\"|{)"
},

"word-group4": {
Expand Down Expand Up @@ -475,9 +477,6 @@
"words": {
"name": "word.red",
"patterns": [
{ "include": "#value-number-hex" },
{ "include": "#value-date" },
{ "include": "#value-time" },
{ "include": "#function-definition" },
{ "include": "#function-definition-does"},
{ "include": "#word-refinement" },
Expand Down
36 changes: 18 additions & 18 deletions Red.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
</dict>
<dict>
<key>include</key>
<string>#words</string>
<string>#values</string>
</dict>
<dict>
<key>include</key>
<string>#values</string>
<string>#words</string>
</dict>
</array>
<key>repository</key>
Expand Down Expand Up @@ -769,7 +769,7 @@
<key>value-money</key>
<dict>
<key>match</key>
<string>(?&lt;!\w)-?[a-zA-Z]*\$[0-9]+(\.[0-9]{2})?</string>
<string>(?&lt;!\w)-?[a-zA-Z]*\$\d+(\.\d*)?</string>
<key>name</key>
<string>number.money.red</string>
</dict>
Expand Down Expand Up @@ -836,6 +836,18 @@
<key>include</key>
<string>#value-money</string>
</dict>
<dict>
<key>include</key>
<string>#value-number-hex</string>
</dict>
<dict>
<key>include</key>
<string>#value-date</string>
</dict>
<dict>
<key>include</key>
<string>#value-time</string>
</dict>
</array>
</dict>
<key>word</key>
Expand All @@ -848,7 +860,7 @@
<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|to)(?=\s|\)|\])</string>
<key>name</key>
<string>support.type.red</string>
</dict>
Expand All @@ -862,7 +874,7 @@
<key>word-group1</key>
<dict>
<key>match</key>
<string>(?&lt;=^|\s|\[|\]|\)|\()(?i)(native|alias|all|any|as-string|as-binary|bind|bound\?|case|catch|checksum|comment|debase|dehex|exclude|difference|disarm|enbase|form|free|get|get-env|in|intersect|minimum-of|maximum-of|mold|new-line|new-line\?|not|now|prin|print|reduce|compose|construct|reverse|save|script\?|set|shift|throw|to-hex|trace|try|type\?|union|charset|unique|unprotect|unset|use|value\?|compress|decompress|secure|open|close|read|read-io|write-io|write|update|query|wait|input\?|exp|log-10|log-2|log-e|square-root|cosine|sine|tangent|arccosine|arcsine|arctangent|protect|lowercase|uppercase|entab|detab|connected\?|browse|launch|stats|get-modes|set-modes|to-local-file|to-rebol-file|encloak|decloak|create-link|do-browser|bind\?|hide|draw|show|size-text|textinfo|offset-to-caret|caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|crypt-strength\?|dh-make-key|dh-generate-key|dh-compute-key|dsa-make-key|dsa-generate-key|dsa-make-signature|dsa-verify-signature|rsa-make-key|rsa-generate-key|rsa-encrypt)(?=\s|\(|\[|/|;|\"|{)</string>
<string>(?&lt;=^|\s|\[|\]|\)|\()(?i)(native|alias|all|any|as-string|as-binary|bind|bound\?|case|catch|checksum|comment|debase|dehex|exclude|difference|disarm|enbase|form|free|get|get-env|in|intersect|minimum-of|maximum-of|mold|new-line|new-line\?|not|now|prin|print|reduce|compose|construct|reverse|save|script\?|set|shift|throw|to-hex|trace|try|type\?|union|charset|unique|unprotect|unset|use|value\?|compress|decompress|secure|open|close|read|read-io|write-io|write|update|query|wait|input\?|exp|log-10|log-2|log-e|square-root|cosine|sine|tangent|arccosine|arcsine|arctangent|arctangent2|atan2|protect|lowercase|uppercase|entab|detab|connected\?|browse|launch|stats|get-modes|set-modes|to-local-file|to-rebol-file|encloak|decloak|create-link|do-browser|bind\?|hide|draw|show|size-text|textinfo|offset-to-caret|caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|crypt-strength\?|dh-make-key|dh-generate-key|dh-compute-key|dsa-make-key|dsa-generate-key|dsa-make-signature|dsa-verify-signature|rsa-make-key|rsa-generate-key|rsa-encrypt)(?=\s|\(|\[|/|;|\"|{)</string>
<key>name</key>
<string>support.function.red</string>
</dict>
Expand All @@ -876,7 +888,7 @@
<key>word-group3</key>
<dict>
<key>match</key>
<string>(?&lt;=^|\s|\[|\]|\)|\()(?i)(insert|append|tail|head|back|repend)(?=\s|\(|\[|\)|\]|/|;|\"|{)</string>
<string>(?&lt;=^|\s|\[|\]|\)|\()(?i)(at|insert|append|tail|head|back|repend|next)(?=\s|\(|\[|\)|\]|/|;|\"|{)</string>
<key>name</key>
<string>keyword.series.red</string>
</dict>
Expand Down Expand Up @@ -935,18 +947,6 @@
<string>word.red</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#value-number-hex</string>
</dict>
<dict>
<key>include</key>
<string>#value-date</string>
</dict>
<dict>
<key>include</key>
<string>#value-time</string>
</dict>
<dict>
<key>include</key>
<string>#function-definition</string>
Expand Down

0 comments on commit 87d0a68

Please sign in to comment.