@@ -25,6 +25,10 @@ variables:
25
25
lit_word_chars : ' [{{lit_word_start_chars}}]{{any_word_chars}}'
26
26
refinement_chars : ' {{any_word_chars}}'
27
27
word_boundary : (?![^{{non_ident_chars}}])
28
+ words_control_conditional : (if|either|unless|case|switch)
29
+ words_control_loop : (foreach|forall|forskip|for|until|while)
30
+ words_control_flow : (break|return|exit|quit|halt|continue)
31
+ words_other_output : (prin(tf?)?|probe|\?\?|\?)
28
32
29
33
first_line_match : ' ^\s*(?i)(Rebol|Red)\s\['
30
34
scope : source.rebol
@@ -462,6 +466,7 @@ contexts:
462
466
captures :
463
467
2 : invalid.illegal.rebol
464
468
- include : match-decl-function
469
+ - include : match-decl-object
465
470
- match : ' ({{ident}})(:){{word_boundary}}'
466
471
captures :
467
472
1 : entity.name.word.set.rebol
@@ -490,26 +495,43 @@ contexts:
490
495
2 : entity.name.word.refinement.rebol
491
496
492
497
match-keywords :
493
- - match : ' (?i)(if|either|unless|case|switch) {{word_boundary}}'
498
+ - match : ' (?i){{words_control_conditional}} {{word_boundary}}'
494
499
scope : keyword.control.conditional.rebol
495
- - match : ' (?i)(foreach|forall|forskip|for|until|while) {{word_boundary}}'
500
+ - match : ' (?i){{words_control_loop}} {{word_boundary}}'
496
501
scope : keyword.control.loop.rebol
497
- - match : ' (?i)(break|return|exit|quit|halt|continue) {{word_boundary}}'
502
+ - match : ' (?i){{words_control_flow}} {{word_boundary}}'
498
503
scope : keyword.control.flow.rebol
499
- - match : ' (?i)(print|prin|probe|\?\?|\?) {{word_boundary}}'
504
+ - match : ' (?i){{words_other_output}} {{word_boundary}}'
500
505
scope : keyword.other.output.rebol
501
506
- match : ' (?i)(==|!=|<=|>=|<>|<|>|=){{word_boundary}}'
502
507
scope : keyword.operator.comparison.rebol
503
508
- match : ' (?i)(all|any|not){{word_boundary}}'
504
509
scope : keyword.operator.logical.rebol
505
- - match : ' (?i)(ui8(le|be|bytes)?|ui16(le|be|bytes)?|ui24(le|be|bytes)?|ui32(le|be|bytes)?|ui64(le|be|bytes)?|si8(le|be|bytes)?|si16(le|be|bytes)?|si24(le|be|bytes)?|si32(le|be|bytes)?|si64(le|be|bytes)?){{word_boundary}}'
506
- scope : storage.type.datatype.bincode.rebol
507
- - match : ' (BIT|SB|UB|INDEX|FIXED8|BYTES){{word_boundary}}'
508
- scope : storage.type.datatype.bincode.rebol
509
510
- match : ' (\+\+|--){{word_boundary}}'
510
511
scope : keyword.operator.assignment.augmented.rebol
512
+ - include : match-keyword-bincode
511
513
- include : match-keyword-tests
512
514
515
+ # Binary dialect (bincode) keywords:
516
+ match-keyword-bincode :
517
+ - match : ' (?i)((u|s)i8(le|be|(le|be)?bytes)?|(u|s)i16(le|be|(le|be)?bytes)?|(u|s)i24(le|be|(le|be)?bytes)?|(u|s)i32(le|be|(le|be)?bytes)?|(u|s)i64(le|be|(le|be)?bytes|EncodedU32)?){{word_boundary}}'
518
+ scope : storage.type.datatype.bincode.integers.rebol
519
+ - match : ' (?i)(float(16)?|double|fixed(8|16)){{word_boundary}}'
520
+ scope : storage.type.datatype.bincode.decimals.rebol
521
+ # words bellow are case sensitive by design (not to colorize any such a word if it's not fully uppercase)
522
+ - match : ' (BITSET(8|16|32)|BIT|(S|U|F)B){{word_boundary}}'
523
+ scope : storage.type.datatype.bincode.bits.rebol
524
+ - match : ' (INDEX(?i)(z)?||LENGTH\?){{word_boundary}}'
525
+ scope : storage.type.datatype.bincode.index-length.rebol
526
+ - match : ' (UNIXTIME-NOW(-LE|-BE)?|MSDOS-(TIME|DATETIME|DATE)){{word_boundary}}'
527
+ scope : storage.type.datatype.bincode.rebol
528
+ - match : ' ((STRING-|OCTAL-)?BYTES){{word_boundary}}'
529
+ scope : storage.type.datatype.bincode.bytes.rebol
530
+ - match : ' TUPLE(3|4){{word_boundary}}'
531
+ scope : storage.type.datatype.bincode.typle.rebol
532
+ - match : ' (SKIP(BITS)?|ALIGN|AT(?i)(z)?){{word_boundary}}'
533
+ scope : storage.type.datatype.bincode.rebol
534
+
513
535
# these are special function names used in unit tests
514
536
match-keyword-tests :
515
537
- match : (~~~(start|end)-file~~~){{word_boundary}}
@@ -553,6 +575,13 @@ contexts:
553
575
# - pop-block
554
576
# - pop-locals
555
577
# - pop-params
578
+ match-decl-object :
579
+ - match : ({{ident}})(:)\s*(object|context)(?![^{{non_ident_chars}}])
580
+ captures :
581
+ 1 : entity.name.class.rebol
582
+ 2 : keyword.operator.assignment.rebol
583
+ 3 : storage.type.class.rebol
584
+
556
585
557
586
match-punctuation :
558
587
- include : match-slash
0 commit comments