-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOcto.sublime-syntax
101 lines (78 loc) · 2.78 KB
/
Octo.sublime-syntax
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
%YAML 1.2
---
name: Octo
scope: source.octo
file_extensions: [8o]
contexts:
main:
# Single line comments
- scope: comment.line.number-sign.octo
match: \#.*
# Data registers
- scope: variable.language.vreg.octo
match: (?<=^|\s)(?i:v\h)(?=$|\s)
# Address register
- scope: variable.language.ireg.octo
match: (?<=^|\s)i(?=$|\s)
# Assignment operators
- scope: keyword.operator.assignment.octo
match: (?<=^|\s)(?:\:=|\+=|\-=|=\-|\|=|&=|\^=|<<=|>>=)(?=$|\s)
# Comparison operators
- scope: keyword.operator.comparison.octo
match: (?<=^|\s)(?:==|!=)(?=$|\s)
# Relational operators
- scope: keyword.operator.relational.octo
match: (?<=^|\s)(?:<=|>=|<|>)(?=$|\s)
# Control flow keywords
- scope: keyword.control.octo
match: (?<=^|\s)(?:return|if|then|begin|else|end|loop|again|while|jump|jump0|\:call|\;)(?=$|\s)
# alias and const directives
- scope: storage.type.octo
match: (?<=^|\s)(?:\:alias|\:const)(?=$|\s)
# Self-modifying code commands
- scope: support.function.octo
match: (?<=^|\s)(?:\:unpack|\:next|\:org)(?=$|\s)
# Metaprogramming commands
- scope: support.function.octo
match: (?<=^|\s)(?:\:macro|\:calc|\:byte|\:pointer|\:stringmode)(?=$|\s)
# Breakpoint command
- scope: support.function.octo
match: (?<=^|\s)(?:\:breakpoint)(?=$|\s)
# Assertion command
- scope: support.function.octo
match: (?<=^|\s)(?:\:assert)(?=$|\s)
# Memory monitor command
- scope: support.function.octo
match: (?<=^|\s)(?:\:monitor)(?=$|\s)
# Deprecated commands
- scope: invalid.deprecated.octo
match: (?<=^|\s)(\:proto)(?=$|\s)
# Statement keywords (standard)
- scope: keyword.other.octo
match: (?<=^|\s)(?:clear|bcd|save|load|sprite|hex|random|delay|pitch|key|-key|buzzer|native)(?=$|\s)
# Statement keywords (SCHIP)
- scope: keyword.other.octo
match: (?<=^|\s)(?:hires|lores|scroll-down|scroll-left|scroll-right|bighex|exit|saveflags|loadflags)(?=$|\s)
# Statement keywords (XO-Chip)
- scope: keyword.other.octo
match: (?<=^|\s)(?:long|plane|audio|scroll-up)(?=$|\s)
# Binary numbers
- scope: constant.numeric.binary.octo
match: (?<=^|\s)[+\-]?0b[01]+(?=$|\s)
# Hexadecimal numbers
- scope: constant.numeric.hexadecimal.octo
match: (?<=^|\s)[+\-]?0x\h+(?=$|\s)
# Decimal numbers
- scope: constant.numeric.decimal.octo
match: (?<=^|\s)[+\-]?\d+(?=$|\s)
# Subroutine scopes
- scope: entity.name.function.octo
match: (?<=^|\s):\s+\S+(?=$|\s)
- match: '"'
push: string
string:
- meta_scope: string.quoted.double.octo
- match: \\[tnrv0\\"]
scope: constant.character.escape.octo
- match: '"'
pop: true