Added sublime syntax

This commit is contained in:
neauoire 2021-02-04 18:25:49 -08:00
parent 7ba9782459
commit 9c78222802
3 changed files with 53 additions and 7 deletions

View File

@ -26,11 +26,12 @@ cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn
- `( comment )`
```
;value ( alloc zero-page variable )
;value ( alloc a zero-page variable )
@0010 ( start at page 1 )
,there [ ,0a ,05 GTH ] JMC
,03 ,02 ADD ,05 EQU
,there ROT JMC
:here
( when not equal )

View File

@ -2,14 +2,14 @@
;var1
;var2
;var3
@0100
:RESET ( --- )
,22 ,var1 STR ( store 0x22 in var1 )
,var1 LDR ( load var2, put value on stack )
@0100 ( store program reset after zero-page )
:RESET ( --- )
BRK
@c000 ( much further.. )

45
extras/usm.sublime-syntax Normal file
View File

@ -0,0 +1,45 @@
%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:
prototype:
- include: comments
main:
- include: keywords
- include: numbers
- include: strings
numbers:
- match: '\@(\S+)\s?'
scope: punctuation.definition
pop: true
strings:
- match: '\:(\S+)\s?'
scope: string.control
pop: true
- match: '\;(\S+)\s?'
scope: string.control
pop: true
- match: '\,(\S+)\s?'
scope: keyword.control
pop: true
- match: '\.(\S+)\s?'
scope: keyword.control
pop: true
comments:
- match: '\('
scope: punctuation.definition.comment.tome
push:
- meta_scope: comment.line.double-slash.tome
- match: '\)'
pop: true