uxn/etc/usm.sublime-syntax

106 lines
2.2 KiB
YAML

%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:
# 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
# templated
- match: '(\S+)\^\!\s?'
scope: entity.name.type.typedef
pop: true
- match: '(\S+)\~\!\s?'
scope: constant.numeric
pop: true
- match: '(\S+)\*\!\s?'
scope: entity.name.type.typedef
pop: true
- match: '(\S+)\=\!\s?'
scope: constant.numeric
pop: true
- match: '(\S+)\^\s?'
scope: entity.name.type.typedef
pop: true
- match: '(\S+)\~\s?'
scope: constant.numeric
pop: true
- match: '(\S+)\*\s?'
scope: entity.name.type.typedef
pop: true
- match: '(\S+)\=\s?'
scope: constant.numeric
pop: true
- match: '(\S+)\?\s?'
scope: storage.type
pop: true
- match: '(\S+)\!\s?'
scope: constant.numeric
pop: true