~rabbits/uxn

ref: 8bf99e6d7620b8bf54fe8ae6031969ec39a0ccb6 uxn/etc/tal.sublime-syntax -rw-r--r-- 2.7 KiB
8bf99e6dneauoire Changed the screen.tal colors to fit the Varvara docs 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: Uxn Assembly
scopeName: tal.
fileTypes: [tal]
file_extensions:
  - tal
scope: source.tal

contexts:
  main:

    # get
    - match: '\.(\S+)\sDEI2'
      scope:  entity.name.type.typedef
      pop: true
    - match: '\.(\S+)\sDEI'
      scope:  entity.name.type.typedef
      pop: true
    - match: '\.(\S+)\sLDZ2'
      scope:  entity.name.type.typedef
      pop: true
    - match: '\.(\S+)\sLDZ'
      scope:  entity.name.type.typedef
      pop: true
    - match: '\,(\S+)\sLDR2'
      scope:  entity.name.type.typedef
      pop: true
    - match: '\,(\S+)\sLDR'
      scope:  entity.name.type.typedef
      pop: true
    - match: '\;(\S+)\sLDA2'
      scope:  constant.numeric
      pop: true
    - match: '\;(\S+)\sLDA'
      scope:  constant.numeric
      pop: true
    # set
    - match: '\.(\S+)\sDEO2'
      scope:  constant.numeric
      pop: true
    - match: '\.(\S+)\sDEO'
      scope:  constant.numeric
      pop: true
    - match: '\.(\S+)\sSTZ2'
      scope:  constant.numeric
      pop: true
    - match: '\.(\S+)\sSTZ'
      scope:  constant.numeric
      pop: true
    - match: '\,(\S+)\sSTR2'
      scope:  constant.numeric
      pop: true
    - match: '\,(\S+)\sSTR'
      scope:  constant.numeric
      pop: true
    - match: '\;(\S+)\sSTA2'
      scope:  entity.name.type.typedef
      pop: true
    - match: '\;(\S+)\sSTA'
      scope:  entity.name.type.typedef
      pop: true

    # label
    - match: '\@(\S+)\s?'
      scope: string.control
      pop: true
    # sublabel
    - match: '\&(\S+)\s?'
      scope: string.control
      pop: true

    # jump
    - match: '\|(\S+)\s?'
      scope: entity.name.tag.structure.any
      pop: true
    # pad
    - match: '\$(\S+)\s?'
      scope: entity.name.tag.structure.any
      pop: true

    # Pushing to stack
    - match: '\"(\S+)\s?'
      scope: variable.parameter.option
      pop: true
    
    # Addressing
    - match: '\.(\S+)\s?'     # zero-page
      scope: variable.function.shell
      pop: true
    - match: '\,(\S+)\s?'     # relative
      scope: entity.name.tag.yaml
      pop: true
    - match: '\;(\S+)\s?'     # absolute
      scope: keyword.control
      pop: true
    - match: '\:(\S+)\s?'     # raw
      scope: keyword.control
      pop: true

      # Blocks
    - match: '\[\s?'
      scope: comment
      pop: true
    - match: '\]\s?'
      scope: comment
      pop: true

    - match: '\{'
      scope: variable.control
      push:
        - meta_scope: variable.control
        - match: '\}'
          pop: true

    - match: '\( '
      scope: comment
      push:
        - meta_scope: comment.line
        - match: ' \)'
          pop: true