c65gm/editor_syntaxes/sublime/c65cm.sublime-syntax

53 lines
1.6 KiB
YAML

%YAML 1.2
---
name: c65cm
file_extensions: [c65]
scope: source.c65cm
contexts:
main:
- include: comments
- include: asm-comments
- include: strings
- include: preprocessor
- include: keywords
- include: assembly-mnemonics
- include: numbers
comments:
- match: //.*$
scope: comment.line.double-slash.c65cm
asm-comments:
- match: ;.*$
scope: comment.line.semicolon.asm.c65cm
strings:
- match: '"'
push: string
string:
- meta_scope: string.quoted.double.c65cm
- match: \\.
scope: constant.character.escape.c65cm
- match: '"'
pop: true
preprocessor:
- match: '^[ \t]*#(INCLUDE|PRAGMA|IFDEF|IFNDEF|IFEND|PRINT|HALT|UNDEF|DEFINE).*$'
scope: meta.preprocessor.c65cm
keywords:
- match: '\b(ADD|AND|AS|ASM|BREAK|BYTE|CALL|CONST|DEC|DECREMENT|ELSE|ENDASM|ENDIF|EXIT|FEND|FOR|FUNC|GETASWORD|GIVING|GOSUB|GOTO|IF|INC|INCREMENT|LABEL|LET|NEXT|OR|PASSING|PEEK|POINTER|POKE|PUTASWORD|STEP|SUBEND|SUBT|SUBTRACT|THEN|TO|VALUE|WHILE|WITH|WEND|WORD|XOR)\b'
scope: keyword.control.c65cm
assembly-mnemonics:
- match: '\b(adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b'
scope: keyword.other.opcode.6502.c65cm
numbers:
- match: '\b(([0-9]+)|([0-9]+\.[0-9]+([Ee][-]?[0-9]+)?))\b'
scope: constant.numeric.decimal.c65cm
- match: '\$[0-9a-fA-F]+'
scope: constant.numeric.hexadecimal.c65cm