update merlin.

This commit is contained in:
Kelvin Sherlock 2017-09-16 22:36:09 -04:00
parent 3fb3d11b3b
commit c1f98ac149

View File

@ -9,10 +9,19 @@ variables:
ident: '[:-~][0-~]*' ident: '[:-~][0-~]*'
contexts: contexts:
prototype:
- include: comment
- include: eol
main: main:
- include: label
label: - meta_include_prototype: false
- match: ^[;*]
push:
- meta_scope: comment.line
- match: \n
pop: true
- match: '{{ws}}' - match: '{{ws}}'
push: opcode push: opcode
@ -46,20 +55,15 @@ contexts:
- match: '^{{ident}}' - match: '^{{ident}}'
scope: entity.name.label scope: entity.name.label
- match: ^[*]|;
push:
- meta_scope: comment.line
- match: \n
pop: true
opcode: opcode:
- match: '{{ws}}' - match: '{{ws}}'
set: operand set: operand
- include: comment - include: comment
- include: mnemonics-6502 - include: scope:source.asm.65816#mnemonics-6502
- include: mnemonics-65c02 - include: scope:source.asm.65816#mnemonics-65c02
- include: mnemonics-65816 - include: scope:source.asm.65816#mnemonics-65816
- include: mnemonics-65816-long - include: scope:source.asm.65816#mnemonics-65816-long
- include: mnemonics-65816-alt - include: mnemonics-65816-alt
# toolbox macros # toolbox macros
@ -136,13 +140,11 @@ contexts:
operand: operand:
- include: comment
- include: numbers - include: numbers
- include: strings - include: strings
#- include: macro-parm #- include: macro-parm
operand-hex: operand-hex:
- include: comment
- match: '[0-9A-Fa-f]{2}' - match: '[0-9A-Fa-f]{2}'
scope: constant.numeric.hex scope: constant.numeric.hex
- match: '[^ \t,]' - match: '[^ \t,]'
@ -150,12 +152,12 @@ contexts:
operand-path: operand-path:
- include: comment - match: \S+
- match: \S
scope: string.unquoted scope: string.unquoted
set: expect-comment
- include: expect-comment
operand-string: operand-string:
- include: comment
- include: strings - include: strings
- match: '[0-9A-Fa-f]{2}' - match: '[0-9A-Fa-f]{2}'
scope: constant.numeric.hex scope: constant.numeric.hex
@ -165,78 +167,66 @@ contexts:
operand-off: operand-off:
- include: comment
- match: \b(?i:OFF)\b - match: \b(?i:OFF)\b
scope: constant.language scope: constant.language
- match: \S set: expect-comment
scope: invalid.illegal.operand - include: expect-comment
operand-cas: operand-cas:
# cas se / cas in # cas se / cas in
- include: comment
- match: \b(?i:SE|IN)\b - match: \b(?i:SE|IN)\b
scope: constant.language scope: constant.language
- match: \S set: expect-comment
scope: invalid.illegal.operand - include: expect-comment
operand-cyc: operand-cyc:
# cyc off | ave | flags # cyc off | ave | flags
- include: comment
- match: \b(?i:OFF|AVE|FLAGS)\b - match: \b(?i:OFF|AVE|FLAGS)\b
scope: constant.language scope: constant.language
- match: \S set: expect-comment
scope: invalid.illegal.operand - include: expect-comment
operand-exp: operand-exp:
# exp on | off | only # exp on | off | only
- include: comment
- match: \b(?i:ON|OFF|ONLY)\b - match: \b(?i:ON|OFF|ONLY)\b
scope: constant.language scope: constant.language
- match: \S set: expect-comment
scope: invalid.illegal.operand - include: expect-comment
operand-lst: operand-lst:
# lst | lst ON | OFF | RTN | FILE,path... # lst | lst ON | OFF | RTN | FILE,path...
- include: comment
- match: \b(?i:ON|OFF|RTN)\b - match: \b(?i:ON|OFF|RTN)\b
scope: constant.language scope: constant.language
set: expect-comment
- match: \b(?i:FILE){{ws}}*, - match: \b(?i:FILE){{ws}}*,
scope: constant.language scope: constant.language
set: operand-path set: operand-path
- match: \S - include: expect-comment
scope: invalid.illegal.operand
operand-tr: operand-tr:
# tr on | off | adr # tr on | off | adr
- include: comment
- match: \b(?i:ON|OFF|ADR)\b - match: \b(?i:ON|OFF|ADR)\b
scope: constant.language scope: constant.language
set: expect-comment
- include: expect-comment
expect-comment:
- include: comment
- match: \S - match: \S
scope: invalid.illegal.operand scope: invalid.illegal.expect.comment
comment: comment:
- match: ;[^\n]* - match: ;
scope: comment.line.partial push:
- match: \n - meta_scope: comment.line
pop: true - match: \n
pop: true
- include: eol
mnemonics-6502:
- match: \b(?i: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.mnemonic.6502
mnemonics-65c02:
- match: \b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\b
scope: keyword.mnemonic.65c02
mnemonics-65816:
- match: \b(?i:BRL|COP|JML|JSL|MVN|MVP|PEA|PEI|PER|PHB|PHD|PHK|PLB|PLD|REP|RTL|SEP|TCD|TCS|TDC|TSC|TXY|TYX|WDM|XBA|XCE)\b
scope: keyword.mnemonic.65816
mnemonics-65816-long:
- match: \b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\b
scope: keyword.mnemonic.65816.long
mnemonics-65816-alt: mnemonics-65816-alt:
- match: \b(?i:TAS|TSA|SWA|TAD|TDA|BLT|BGE)\b - match: \b(?i:TAS|TSA|SWA|TAD|TDA|BLT|BGE)\b
@ -254,23 +244,27 @@ contexts:
- match: "'" - match: "'"
scope: punctuation.definition.string.begin scope: punctuation.definition.string.begin
push: push:
- meta_include_prototype: false
- meta_scope: string.quoted.single
- match: "'" - match: "'"
scope: punctuation.definition.string.end scope: punctuation.definition.string.end
pop: true pop: true
- match: \n - match: \n
scope: invalid.illegal.newline.asm scope: invalid.illegal.newline.asm
pop: true pop: true
- match: .
scope: string.quoted.single
- match: '"' - match: '"'
scope: punctuation.definition.string.begin scope: punctuation.definition.string.begin
push: push:
- meta_include_prototype: false
- meta_scope: string.quoted.double
- match: '"' - match: '"'
scope: punctuation.definition.string.end scope: punctuation.definition.string.end
pop: true pop: true
- match: \n - match: \n
scope: invalid.illegal.newline.asm scope: invalid.illegal.newline.asm
pop: true pop: true
- match: .
scope: string.quoted.double eol:
- match: '$'
pop: true