uxn/etc/usm.sublime-syntax

76 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-02-04 21:25:49 -05:00
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: Uxn Assembly
scopeName: usm.
fileTypes: [usm]
file_extensions:
- usm
scope: source.usm
contexts:
main:
2021-02-28 12:40:19 -05:00
# pointer
- match: '\@(\S+)\s?'
2021-02-04 21:25:49 -05:00
scope: string.control
pop: true
2021-02-28 12:40:19 -05:00
# jump
- match: '\|(\S+)\s?'
scope: variable.control
pop: true
2021-04-20 00:33:52 -04:00
- match: '\$(\S+)\s?'
scope: variable.control
2021-02-04 21:25:49 -05:00
pop: true
2021-02-28 12:40:19 -05:00
# constants
- match: '\:(\S+)\s?'
2021-02-05 13:51:45 -05:00
scope: string.control
pop: true
2021-02-28 12:40:19 -05:00
# structs
# Special
2021-04-20 00:33:52 -04:00
- match: '\&(\S+)\s?'
2021-04-20 13:31:50 -04:00
scope: entity.name.type
2021-02-28 12:40:19 -05:00
pop: true
# Pushing to stack
2021-04-20 00:33:52 -04:00
- match: '\#(\S+)\s?'
2021-02-12 19:18:52 -05:00
scope: keyword.control
pop: true
2021-04-20 00:33:52 -04:00
# Addressing
- match: '\.(\S+)\s?' # zero-page
scope: variable.control
2021-03-11 15:19:59 -05:00
pop: true
2021-04-20 00:33:52 -04:00
- match: '\,(\S+)\s?' # relative
scope: entity.name.type
pop: true
- match: '\;(\S+)\s?' # absolute
2021-02-04 21:25:49 -05:00
scope: keyword.control
pop: true
2021-02-28 12:40:19 -05:00
2021-04-20 13:48:55 -04:00
- match: '\[\s?'
scope: comment
pop: true
- match: '\]\s?'
scope: comment
pop: true
2021-04-20 00:33:52 -04:00
2021-02-28 12:40:19 -05:00
# Blocks
- match: '\{'
scope: variable.control
2021-02-23 01:15:02 -05:00
push:
2021-02-28 12:40:19 -05:00
- meta_scope: variable.control
- match: '\}'
2021-02-23 01:15:02 -05:00
pop: true
2021-02-04 21:25:49 -05:00
- match: '\('
2021-02-28 12:40:19 -05:00
scope: comment
2021-02-04 21:25:49 -05:00
push:
2021-02-28 12:40:19 -05:00
- meta_scope: comment.line
2021-02-04 21:25:49 -05:00
- match: '\)'
pop: true