From 6de1c1dfedd98cb160ea37db8d78a344207e26a1 Mon Sep 17 00:00:00 2001 From: Georg Ziegler Date: Tue, 20 Mar 2018 21:32:56 +0100 Subject: [PATCH] cc65 6502 grammar working, splitting 65X opcodes --- grammars/6502ex-opcodes.cson | 23 ------------------ grammars/6502x-opcodes.cson | 24 +++++++++++++++++++ ...{65616-opcodes.cson => 65816-opcodes.cson} | 0 grammars/65c02-opcodes.cson | 3 ++- grammars/cc65-toolchain.cson | 8 +++++-- 5 files changed, 32 insertions(+), 26 deletions(-) delete mode 100644 grammars/6502ex-opcodes.cson create mode 100644 grammars/6502x-opcodes.cson rename grammars/{65616-opcodes.cson => 65816-opcodes.cson} (100%) diff --git a/grammars/6502ex-opcodes.cson b/grammars/6502ex-opcodes.cson deleted file mode 100644 index 2437027..0000000 --- a/grammars/6502ex-opcodes.cson +++ /dev/null @@ -1,23 +0,0 @@ -# Adds the pseudo codes known as 6502EX to the basic 6502 instruction set - -scopeName: 'source.6502ex-opcodes' - -patterns: [ - # The 6502 pseudo opcodes known as 6502EX - { - include: '#mnemonics-6502ex' - } -] - -# Respository starts here ----------------------------------------------------- -repository: - - # 6502 pseudo op codes - 'mnemonics-6502ex': - patterns: [ - # mnemonics - { - match: '\\b(?i:ALR|ANC|ARR|AXS|DCP|ISC|LAS|LAX|RLA|RRA|SAX|SLO|SRE)\\b' - name: 'keyword.mnemonic.6502.6502ex-opcodes' - } - ] diff --git a/grammars/6502x-opcodes.cson b/grammars/6502x-opcodes.cson new file mode 100644 index 0000000..d9ef278 --- /dev/null +++ b/grammars/6502x-opcodes.cson @@ -0,0 +1,24 @@ +# Adds the pseudo codes known as 6502X to the basic 6502 instruction set +# NOTE: look for extra opcodes: jam + +scopeName: 'source.6502x-opcodes' + +patterns: [ + # The 6502 pseudo opcodes known as 6502X + { + include: '#mnemonics-6502x' + } +] + +# Respository starts here ----------------------------------------------------- +repository: + + # 6502 pseudo op codes + 'mnemonics-6502x': + patterns: [ + # mnemonics + { + match: '\\b(?i:ALR|ANC|ARR|AXS|DCP|ISC|LAS|LAX|RLA|RRA|SAX|SLO|SRE)\\b' + name: 'keyword.mnemonic.6502.6502x-opcodes' + } + ] diff --git a/grammars/65616-opcodes.cson b/grammars/65816-opcodes.cson similarity index 100% rename from grammars/65616-opcodes.cson rename to grammars/65816-opcodes.cson diff --git a/grammars/65c02-opcodes.cson b/grammars/65c02-opcodes.cson index 954ecdc..0233eca 100644 --- a/grammars/65c02-opcodes.cson +++ b/grammars/65c02-opcodes.cson @@ -1,6 +1,7 @@ # Extends the basic 6502 instruction set with the 65c02 op codes +# NOTE: rmb, bbr, smb, bbs not supported yet -scopeName: 'source.65816-opcodes' +scopeName: 'source.65c02-opcodes' patterns: [ # The basic 6502 instruction set diff --git a/grammars/cc65-toolchain.cson b/grammars/cc65-toolchain.cson index d5f6eb0..4aeb1cd 100644 --- a/grammars/cc65-toolchain.cson +++ b/grammars/cc65-toolchain.cson @@ -1,7 +1,7 @@ # Syntax Highlighting for the cc65 toolchain scopeName: 'source.cc65-toolchain' -name: '6502 Assembly (cc65) --TEST--' # Name shown in Atom Editor grammar selection +name: '6502 Assembly (cc65)' # Name shown in Atom Editor grammar selection # File extensions associated with this package fileTypes: [ 's' @@ -9,7 +9,11 @@ fileTypes: [ patterns: [ # The 65c02 instruction set { - include: 'source.6502-opcodes' + include: 'source.65c02-opcodes' + } + # Include the 6502ex op codes + { + include: 'source.6502x-opcodes' } # The cc65 toolchain considers everything after a semicolon(;) as comment {