Skip to content

Commit 977ba9b

Browse files
committed
Fixed money! datatype and handling negative numbers.
1 parent 265d899 commit 977ba9b

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

Rebol.JSON-tmLanguage

+9-10
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
{"include": "#comments"},
1111
{"include": "#type-literal"},
1212
{"include": "#strings"},
13-
{"include": "#words"},
14-
{"include": "#values"}
15-
13+
{"include": "#values"},
14+
{"include": "#words"}
1615
],
1716
"repository": {
1817

@@ -318,7 +317,7 @@
318317

319318
"value-money": {
320319
"name": "number.money.rebol",
321-
"match": "(?<!\\w)-?[a-zA-Z]*\\$[0-9]+(\\.[0-9]{2})?"
320+
"match": "(?<!\\w)-?[a-zA-Z]*\\$\\d+(\\.\\d*)?"
322321
},
323322

324323
"value-number": {
@@ -354,7 +353,10 @@
354353
{ "include": "#value-tuple" },
355354
{ "include": "#value-number" },
356355
{ "include": "#value-pair" },
357-
{ "include": "#value-money" }
356+
{ "include": "#value-money" },
357+
{ "include": "#value-number-hex" },
358+
{ "include": "#value-date" },
359+
{ "include": "#value-time" }
358360
]
359361
},
360362

@@ -390,7 +392,7 @@
390392

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

396398
"word-group1": {
@@ -405,7 +407,7 @@
405407

406408
"word-group3": {
407409
"name": "keyword.series.rebol",
408-
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()(?i)(insert|append|tail|head|back|repend)(?=\\s|\\(|\\[|\\)|\\]|/|;|\\\"|{)"
410+
"match": "(?<=^|\\s|\\[|\\]|\\)|\\()(?i)(at|insert|append|tail|head|back|repend|next)(?=\\s|\\(|\\[|\\)|\\]|/|;|\\\"|{)"
409411
},
410412

411413
"word-group4": {
@@ -469,9 +471,6 @@
469471
"words": {
470472
"name": "word.rebol",
471473
"patterns": [
472-
{ "include": "#value-number-hex" },
473-
{ "include": "#value-date" },
474-
{ "include": "#value-time" },
475474
{ "include": "#function-definition" },
476475
{ "include": "#function-definition-does"},
477476
{ "include": "#word-refinement" },

Rebol.tmLanguage

+17-17
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
</dict>
3434
<dict>
3535
<key>include</key>
36-
<string>#words</string>
36+
<string>#values</string>
3737
</dict>
3838
<dict>
3939
<key>include</key>
40-
<string>#values</string>
40+
<string>#words</string>
4141
</dict>
4242
</array>
4343
<key>repository</key>
@@ -771,7 +771,7 @@
771771
<key>value-money</key>
772772
<dict>
773773
<key>match</key>
774-
<string>(?&lt;!\w)-?[a-zA-Z]*\$[0-9]+(\.[0-9]{2})?</string>
774+
<string>(?&lt;!\w)-?[a-zA-Z]*\$\d+(\.\d*)?</string>
775775
<key>name</key>
776776
<string>number.money.rebol</string>
777777
</dict>
@@ -838,6 +838,18 @@
838838
<key>include</key>
839839
<string>#value-money</string>
840840
</dict>
841+
<dict>
842+
<key>include</key>
843+
<string>#value-number-hex</string>
844+
</dict>
845+
<dict>
846+
<key>include</key>
847+
<string>#value-date</string>
848+
</dict>
849+
<dict>
850+
<key>include</key>
851+
<string>#value-time</string>
852+
</dict>
841853
</array>
842854
</dict>
843855
<key>word</key>
@@ -850,7 +862,7 @@
850862
<key>word-datatype</key>
851863
<dict>
852864
<key>match</key>
853-
<string>(?&lt;=^|\s|\[|\]|\)|\()([A-Za-z_0-9=_\-\?\*\+\.~:']+\!|as)(?=\s|\)|\])</string>
865+
<string>(?&lt;=^|\s|\[|\]|\)|\()([A-Za-z_0-9=_\-\?\*\+\.~:']+\!|as|to)(?=\s|\)|\])</string>
854866
<key>name</key>
855867
<string>support.type.rebol</string>
856868
</dict>
@@ -878,7 +890,7 @@
878890
<key>word-group3</key>
879891
<dict>
880892
<key>match</key>
881-
<string>(?&lt;=^|\s|\[|\]|\)|\()(?i)(insert|append|tail|head|back|repend)(?=\s|\(|\[|\)|\]|/|;|\"|{)</string>
893+
<string>(?&lt;=^|\s|\[|\]|\)|\()(?i)(at|insert|append|tail|head|back|repend|next)(?=\s|\(|\[|\)|\]|/|;|\"|{)</string>
882894
<key>name</key>
883895
<string>keyword.series.rebol</string>
884896
</dict>
@@ -930,18 +942,6 @@
930942
<string>word.rebol</string>
931943
<key>patterns</key>
932944
<array>
933-
<dict>
934-
<key>include</key>
935-
<string>#value-number-hex</string>
936-
</dict>
937-
<dict>
938-
<key>include</key>
939-
<string>#value-date</string>
940-
</dict>
941-
<dict>
942-
<key>include</key>
943-
<string>#value-time</string>
944-
</dict>
945945
<dict>
946946
<key>include</key>
947947
<string>#function-definition</string>

0 commit comments

Comments
 (0)