From 376a1e0f55e08fcc654061f285033836fd988407 Mon Sep 17 00:00:00 2001 From: Georg Ziegler Date: Tue, 20 Mar 2018 20:54:24 +0100 Subject: [PATCH 1/5] Squash develope commits into one --- README.md | 4 +- grammars/6502 Assembly (cc65).cson | 101 --------------------- grammars/6502-opcodes.cson | 35 ++++++++ grammars/6502ex-opcodes.cson | 23 +++++ grammars/65616-opcodes.cson | 27 ++++++ grammars/65c02-opcodes.cson | 27 ++++++ grammars/cc65-toolchain.cson | 135 +++++++++++++++++++++++++++++ settings/language-65asm.cson | 36 ++++---- 8 files changed, 267 insertions(+), 121 deletions(-) delete mode 100644 grammars/6502 Assembly (cc65).cson create mode 100644 grammars/6502-opcodes.cson create mode 100644 grammars/6502ex-opcodes.cson create mode 100644 grammars/65616-opcodes.cson create mode 100644 grammars/65c02-opcodes.cson create mode 100644 grammars/cc65-toolchain.cson diff --git a/README.md b/README.md index 9ab025f..e285fed 100755 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ config.cson (`ctrl+shift+p` -> config): ``` "*": - core: + core: customFileTypes: { "source.assembly.6502.cc65": [ "asm" @@ -42,7 +42,7 @@ config.cson (`ctrl+shift+p` -> config): } ``` -See last line in grammar files for names. +See first line in grammar files for names. # Contributors diff --git a/grammars/6502 Assembly (cc65).cson b/grammars/6502 Assembly (cc65).cson deleted file mode 100644 index fdff2b9..0000000 --- a/grammars/6502 Assembly (cc65).cson +++ /dev/null @@ -1,101 +0,0 @@ -'fileTypes': [ - 's' -] -'name': '6502 Assembly (cc65)' -'patterns': [ - { - 'include': '#M6502' - } - { - 'include': '#M6502X' - } - { - 'include': '#M65C02' - } - { - 'include': '#M65816' - } - { - 'include': '#M65816_alias' - } - { - 'match': ';.*$' - 'name': 'comment.line.semicolon' - } - { - 'begin': '"' - 'beginCaptures': - '0': - 'name': 'punctuation.definition.string.begin' - 'end': '"' - 'endCaptures': - '0': - 'name': 'punctuation.definition.string.end' - 'name': 'string.quoted.double.assembly' - } - { - 'match': '\\#(\'.\'|[^\\s\']+)' - 'name': 'constant.numeric.hex' - } - { - 'match': '\\$[A-Fa-f0-9]+' - 'name': 'constant.numeric.hex' - } - { - 'match': '\\b([0-9]+)h\\b' - 'name': 'constant.numeric.hex' - } - { - 'match': '%[01]+' - 'name': 'constant.numeric.binary' - } - { - 'match': '\\b([0-9]+)\\b' - 'name': 'constant.numeric.decimal' - } - { - 'match': '^[A-Za-z_][A-Za-z0-9_]*:' - 'name': 'variable.other.readwrite.assembly' # 'entity.name.label' - } - { - 'match': '^@[A-Za-z_][A-Za-z0-9_]*' - 'name': 'variable.other.readwrite.instance.assembly' # 'entity.name.label.local' - } - { - 'match': '(\\.)?\\b(?i:bank|bankbyte|blank|concat|const|hibyte|hiword|ident|left|lobyte|loword|match|max|mid|min|ref|referenced|right|sizeof|sprintf|strat|string|strlen|tcount|xmatch)\\b' - 'name': 'support.function.pseudo' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc10 - } - { - 'match': '(\\.)?\\b(?i:a16|a8|addr|align|asciiz|assert|autoimport|bankbytes|bss|byt|byte|case|charmap|code|condes|constructor|data|dbyt|debuginfo|def|define|defined|delmac|delmacro|destructor|dword|else|elseif|end|endenum|endif|endmac|endmacro|endproc|endrep|endrepeat|endscope|endstruct|endunion|enum|error|exitmac|exitmacro|export|exportzp|faraddr|fatal|feature|fileopt|fopt|forceimport|global|globalzp|hibytes|i16|i8|if|ifblank|ifconst|ifdef|ifnblank|ifndef|ifnref|ifp02|ifp816|ifpc02|ifpsc02|ifref|import|importzp|incbin|include|interruptor|linecont|list|listbytes|lobytes|local|localchar|mac|macpack|macro|org|out|p02|p816|pagelen|pagelength|pc02|popcpu|popseg|proc|psc02|pushcpu|pushseg|reloc|repeat|res|rodata|scope|segment|set|setcpu|smart|struct|tag|undef|undefine|union|warning|word|zeropage)\\b' - 'name': 'storage.modifier' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc11 - } - { - 'match': '\\b(CPU_6502|CPU_65SC02|CPU_65C02|CPU_65816|CPU_SWEET16|CPU_HUC6280|CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_65816|CPU_ISET_SWEET16|CPU_ISET_HUC6280|__APPLE2__|__APPLE2ENH__|__ATARI__|__ATARIXL__|__ATMOS__|__BBC__|__C128__|__C16__|__C64__|__CBM__|__CBM510__|__CBM610__|__GEOS__|__GEOS_APPLE__|__GEOS_CBM__|__LUNIX__|__LYNX__|__NES__|__PET__|__PLUS4__|__SIM6502__|__SIM65C02__|__SUPERVISION__|__VIC20__)\\b' - 'name': 'constant.language.assembly.cc65' - } - { - 'match': '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|' - 'name': 'keyword.operator.assembly.cc65' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc5.5 - } - { - 'match': '(\\.)\\b(?i:and|bankbyte|bitand|bitnot|bitor|bitxor|hibyte|lobyte|mod|not|or|shl|shr|xor)\\b' - 'name': 'keyword.operator.assembly.cc65' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc5.5 - } -] -'repository': - 'M6502': - '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' - 'name': 'keyword.mnemonic.6502' - 'M6502X': - 'match': '\\b(?i:ALR|ANC|ARR|AXS|DCP|ISC|LAS|LAX|RLA|RRA|SAX|SLO|SRE)\\b' - 'name': 'keyword.mnemonic.6502x' - 'M65816': - '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' - 'name': 'keyword.mnemonic.65816' - 'M65816_alias': - 'match': '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b' - 'name': 'keyword.mnemonic.65816_alias' - 'M65C02': - 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' - 'name': 'keyword.mnemonic.65c02' -'scopeName': 'source.assembly.6502.cc65' diff --git a/grammars/6502-opcodes.cson b/grammars/6502-opcodes.cson new file mode 100644 index 0000000..9461e41 --- /dev/null +++ b/grammars/6502-opcodes.cson @@ -0,0 +1,35 @@ +# Syntax Highlighting for the basic instruction set of the 6502 microprocessor. +# This file only contains rules for 6502 mnemonics. The rules here are used by +# other grammars only that add rules for comments, symbols, etc. + +scopeName: 'source.6502-opcodes' + +patterns: [ + # The basic 6502 instruction set + { + include: '#mnemonics-6502' + } +] + +# Respository starts here ----------------------------------------------------- +repository: + + # basic 6502 instruction set + 'mnemonics-6502': + patterns: [ + # mnemonics + { + 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' + name: 'keyword.mnemonic.6502.6502-opcodes' + } + ] +# 'M65816': +# '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' +# 'name': 'keyword.mnemonic.65816' +# 'M65816_alias': +# 'match': '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b' +# 'name': 'keyword.mnemonic.65816_alias' +# 'M65C02': +# 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' +# 'name': 'keyword.mnemonic.65c02' +# 'scopeName': 'source.assembly.6502' diff --git a/grammars/6502ex-opcodes.cson b/grammars/6502ex-opcodes.cson new file mode 100644 index 0000000..2437027 --- /dev/null +++ b/grammars/6502ex-opcodes.cson @@ -0,0 +1,23 @@ +# 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/65616-opcodes.cson b/grammars/65616-opcodes.cson new file mode 100644 index 0000000..033005f --- /dev/null +++ b/grammars/65616-opcodes.cson @@ -0,0 +1,27 @@ +# Extends the basic 6502 instruction set with the basic 65816 instruction set + +scopeName: 'source.65816-opcodes' + +patterns: [ + # The 65c02 instruction set + { + include: 'source.65c02-opcodes' + } + # The 65816 instruction set + { + include: '#mnemonics-65816' + } +] + +# Respository starts here ----------------------------------------------------- +repository: + + # 65816 instruction set + 'mnemonics-65816': + patterns: [ + # mnemonics + { + 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' + name: 'keyword.mnemonic.65816.65816-opcodes' + } + ] diff --git a/grammars/65c02-opcodes.cson b/grammars/65c02-opcodes.cson new file mode 100644 index 0000000..954ecdc --- /dev/null +++ b/grammars/65c02-opcodes.cson @@ -0,0 +1,27 @@ +# Extends the basic 6502 instruction set with the 65c02 op codes + +scopeName: 'source.65816-opcodes' + +patterns: [ + # The basic 6502 instruction set + { + include: 'source.6502-opcodes' + } + # The added 65c02 op codes + { + include: '#mnemonics-65c02' + } +] + +# Respository starts here ----------------------------------------------------- +repository: + + # basic 6502 instruction set + 'mnemonics-65c02': + patterns: [ + # mnemonics + { + match: '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' + name: 'keyword.mnemonic.65c02.65c02-opcodes' + } + ] diff --git a/grammars/cc65-toolchain.cson b/grammars/cc65-toolchain.cson new file mode 100644 index 0000000..d5f6eb0 --- /dev/null +++ b/grammars/cc65-toolchain.cson @@ -0,0 +1,135 @@ +# Syntax Highlighting for the cc65 toolchain + +scopeName: 'source.cc65-toolchain' +name: '6502 Assembly (cc65) --TEST--' # Name shown in Atom Editor grammar selection +# File extensions associated with this package +fileTypes: [ + 's' +] +patterns: [ + # The 65c02 instruction set + { + include: 'source.6502-opcodes' + } + # The cc65 toolchain considers everything after a semicolon(;) as comment + { + include: '#comments' + } + # symbols, constants, numbers + { + include: '#symbols' + } + # directives + { + include: '#directives' + } +] + +# Repository starts here ------------------------------------------------------ +repository: + + # comments + comments: + patterns: [ + # semicolon comments + { + match: ';.*$' + name: 'comment.line.semicolon.cc65-toolchain' + } + ] + + # symbols + symbols: + patterns: [ + { + begin: '"' + beginCaptures: + 0: + name: 'punctuation.definition.string.begin.cc65-toolchain' + end: '"' + endCaptures: + 0: + name: 'punctuation.definition.string.end.cc65-toolchain' + name: 'string.quoted.double.assembly.cc65-toolchain' + } + # absolut addressing/numbering + { + match: '\\#(\'.\'|[^\\s\']+)' + name: 'constant.numeric.hex.cc65-toolchain' + } + # hex, prefixed with ampersand($) + { + match: '-?\\$[A-Fa-f0-9]+' + name: 'constant.numeric.hex.cc65-toolchain' + } + # hex, suffixed with h(h) + { + match: '-?([0-9]+)h' + name: 'constant.numeric.hex.cc65-toolchain' + } + # binary + { + match: '%[01]+' + name: 'constant.numeric.binary.cc65-toolchain' + } + # decimal + { + match: '\\b([0-9]+)\\b' + name: 'constant.numeric.decimal.cc65-toolchain' + } + ] + + # assembler directives + directives: + patterns: [ + # ca65 pseudo variables + { + match: '(\\.)?\\b(?i:\\*|asize|cpu|isize|paramcount|time|version)\\b' + name: 'support.function.pseudo.cc65-toolchain' + } + # ca65 pseudo functions + { + match: '(\\.)?\\b(?i:addrsize|bank(byte)?|blank|con(cat|st)|(hi|lo)(byte|word)|ident|left|x?match|max|mi[dn]|ref(erenced)?|right|sizeof|strat|sprintf|str(ing|len)|tcount)\\b' + name: 'support.function.pseudo.cc65-toolchain' + } + # ca65 control commands, A through C + { + match: '(\\.)?\\b(?i:a(8|16)|addr|align|asciiz|assert|autoimport|(bank|hi)bytes|bss|byte?|case|charmap|code|condes|(con|de)structor)\\b' + name: 'storage.modifier.cc65-toolchain' + } + # ca65 control commands, D and E + { + match: '(\\.)?\\b(?i:data|dbyt|debuginfo|define|delmac(ro)?|def(ined(macro)?)?|dword|else(if)?|end(enum)?|end(enum|if|proc|rep(eat)?|scope|struct|union)?|endmac(ro)?|enum|error|exitmac(ro)?|export(zp)?)\\b' + name: 'storage.modifier.cc65-toolchain' + } + # ca65 control commands, F through I + { + match: '(\\.)?\\b(?i:faraddr|fatal|feature|f(ile)?opt|forceimport|global(zp)?|i(8|16)|if((n)?blank|const|(n)?def|(n)?ref|p02|p4510|p816|p(s)?c02)?|import(zp)?|inc(bin|lude)|interruptor|ismnem(onic)?)\\b' + name: 'storage.modifier.cc65-toolchain' + } + # ca65 control commands, L through R + { + match: '(\\.)?\\b(?i:linecont|list(bytes)?|lobytes|local(char)?|macpack|mac(ro)?|org|out|p02|p4510|p816|pagelen(gth)?|pc02|pop(cpu|seg)|proc|psc02|push(cpu|seg)|reloc|repeat|res|rodata)\\b' + name: 'storage.modifier.cc65-toolchain' + } + # ca65 control commands, S through Z + { + match: '(\\.)?\\b(?i:scope|segment|set(cpu)?|smart|struct|tag|undef(ine)?|union|warning|word|zeropage)\\b' + name: 'storage.modifier.cc65-toolchain' + } + # CPU constants + { + match: '\\b(CPU_6502|CPU_65SC02|CPU_65C02|CPU_65816|CPU_SWEET16|CPU_HUC6280|CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_65816|CPU_ISET_SWEET16|CPU_ISET_HUC6280|__APPLE2__|__APPLE2ENH__|__ATARI__|__ATARIXL__|__ATMOS__|__BBC__|__C128__|__C16__|__C64__|__CBM__|__CBM510__|__CBM610__|__GEOS__|__GEOS_APPLE__|__GEOS_CBM__|__LUNIX__|__LYNX__|__NES__|__PET__|__PLUS4__|__SIM6502__|__SIM65C02__|__SUPERVISION__|__VIC20__)\\b' + name: 'constant.other.cc65-toolchain' + } + # Operators + { + match: '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|' + name: 'keyword.operator.cc65-toolchain' + } + # Operators II + { + match: '(\\.)\\b(?i:and|(bit)?(and|not|or|xor)|mod|shl|shr)\\b' + name: 'keyword.operator.cc65-toolchain' + } + ] diff --git a/settings/language-65asm.cson b/settings/language-65asm.cson index 9908f2e..137d861 100644 --- a/settings/language-65asm.cson +++ b/settings/language-65asm.cson @@ -1,18 +1,18 @@ -'.source.assembly': - 'editor': - 'commentStart': ';' -'.source.assembly.6502.edasm': - 'editor': - 'foldEndPattern': '\\b(?i:DEND|FIN)\\b' -'.source.assembly.65816.mpw': - 'editor': - 'foldEndPattern': '\\b(?i:ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|ENDR|ENDSTACK|ENDWITH|ENDM|ENDMACRO|MEND)\\b' -'.source.assembly.65816.merlin': - 'editor': - 'foldEndPattern': '\\b(?i:DEND|FIN)\\b|<<<|--\\^' -'.source.assembly.65816.ninjaforce': - 'editor': - 'foldEndPattern': '(\\^\\^\\^|\\<\\<\\<)' -'.source.assembly.65816.orcam': - 'editor': - 'foldEndPattern': '\\b(?i:END)\\b' +# '.source.assembly': +# 'editor': +# 'commentStart': ';' +# '.source.assembly.6502.edasm': +# 'editor': +# 'foldEndPattern': '\\b(?i:DEND|FIN)\\b' +# '.source.assembly.65816.mpw': +# 'editor': +# 'foldEndPattern': '\\b(?i:ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|ENDR|ENDSTACK|ENDWITH|ENDM|ENDMACRO|MEND)\\b' +# '.source.assembly.65816.merlin': +# 'editor': +# 'foldEndPattern': '\\b(?i:DEND|FIN)\\b|<<<|--\\^' +# '.source.assembly.65816.ninjaforce': +# 'editor': +# 'foldEndPattern': '(\\^\\^\\^|\\<\\<\\<)' +# '.source.assembly.65816.orcam': +# 'editor': +# 'foldEndPattern': '\\b(?i:END)\\b' From 6de1c1dfedd98cb160ea37db8d78a344207e26a1 Mon Sep 17 00:00:00 2001 From: Georg Ziegler Date: Tue, 20 Mar 2018 21:32:56 +0100 Subject: [PATCH 2/5] 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 { From bca192fbc79e4712f9f74ef53c6c42d8c3ff03c4 Mon Sep 17 00:00:00 2001 From: Georg Ziegler Date: Thu, 22 Mar 2018 18:08:30 +0100 Subject: [PATCH 3/5] Rework cc65 support --- grammars/6502x-opcodes.cson | 4 +- grammars/65816-aliases.cson | 23 ++++++ grammars/65c02-opcodes.cson | 8 +- grammars/cc65-816-toolchain.cson | 13 +++ grammars/cc65-directives.cson | 135 ++++++++++++++++++++++++++++++ grammars/cc65-toolchain.cson | 137 ++----------------------------- 6 files changed, 183 insertions(+), 137 deletions(-) create mode 100644 grammars/65816-aliases.cson create mode 100644 grammars/cc65-816-toolchain.cson create mode 100644 grammars/cc65-directives.cson diff --git a/grammars/6502x-opcodes.cson b/grammars/6502x-opcodes.cson index d9ef278..70e17b4 100644 --- a/grammars/6502x-opcodes.cson +++ b/grammars/6502x-opcodes.cson @@ -13,12 +13,12 @@ patterns: [ # Respository starts here ----------------------------------------------------- repository: - # 6502 pseudo op codes + # 6502x pseudo opcodes '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' + name: 'keyword.mnemonic.6502x.6502x-opcodes' } ] diff --git a/grammars/65816-aliases.cson b/grammars/65816-aliases.cson new file mode 100644 index 0000000..1a3fd05 --- /dev/null +++ b/grammars/65816-aliases.cson @@ -0,0 +1,23 @@ +# Aliases for certain opcodes used by many assemblers + +scopeName: 'source.65816-aliases' + +patterns: [ + # The 65816 instruction set aliases + { + include: '#mnemonics-65816-aliases' + } +] + +# Respository starts here ----------------------------------------------------- +repository: + + # 65816 instruction set aliases + 'mnemonics-65816-aliases': + patterns: [ + # mnemonics + { + match: '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b' + name: 'keyword.mnemonic.65816.65816-aliases' + } + ] diff --git a/grammars/65c02-opcodes.cson b/grammars/65c02-opcodes.cson index 0233eca..e0ecbfe 100644 --- a/grammars/65c02-opcodes.cson +++ b/grammars/65c02-opcodes.cson @@ -1,5 +1,5 @@ -# Extends the basic 6502 instruction set with the 65c02 op codes -# NOTE: rmb, bbr, smb, bbs not supported yet +# Extends the basic 6502 instruction set with the 65c02 opcodes +# NOTE: rmb, bbr, smb, bbs not supported scopeName: 'source.65c02-opcodes' @@ -8,7 +8,7 @@ patterns: [ { include: 'source.6502-opcodes' } - # The added 65c02 op codes + # The added 65c02 opcodes { include: '#mnemonics-65c02' } @@ -17,7 +17,7 @@ patterns: [ # Respository starts here ----------------------------------------------------- repository: - # basic 6502 instruction set + # 65c02 instruction set extension 'mnemonics-65c02': patterns: [ # mnemonics diff --git a/grammars/cc65-816-toolchain.cson b/grammars/cc65-816-toolchain.cson new file mode 100644 index 0000000..69fed09 --- /dev/null +++ b/grammars/cc65-816-toolchain.cson @@ -0,0 +1,13 @@ +# Syntax Highlighting for the cc65 toolchain and 65816 support + +scopeName: 'source.cc65-816-toolchain' +name: '65816 Assembly (cc65)' # Name shown in Atom Editor grammar selection +# File extensions associated with this grammar +fileTypes: [ + 's' +] +patterns: [ + { include: 'source.65816-opcodes' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes + { include: 'source.6502x-opcodes' } # extend with 6502X opcodes + { include: 'source.cc65-directives' } # include the directives for the cc65 toolchain +] diff --git a/grammars/cc65-directives.cson b/grammars/cc65-directives.cson new file mode 100644 index 0000000..290544a --- /dev/null +++ b/grammars/cc65-directives.cson @@ -0,0 +1,135 @@ +# Syntax Highlighting for the cc65 toolchain directives + +scopeName: 'source.cc65-directives' + +patterns: [ + # # The 65c02 instruction set + # { + # include: 'source.65c02-opcodes' + # } + # # Include the 6502ex op codes + # { + # include: 'source.6502x-opcodes' + # } + # The cc65 toolchain considers everything after a semicolon(;) as comment + { + include: '#comments' + } + # symbols, constants, numbers + { + include: '#symbols' + } + # directives + { + include: '#directives' + } +] + +# Repository starts here ------------------------------------------------------ +repository: + + # comments + comments: + patterns: [ + # semicolon comments + { + match: ';.*$' + name: 'comment.line.semicolon.cc65-directives' + } + ] + + # symbols + symbols: + patterns: [ + { + begin: '"' + beginCaptures: + 0: + name: 'punctuation.definition.string.begin.cc65-directives' + end: '"' + endCaptures: + 0: + name: 'punctuation.definition.string.end.cc65-directives' + name: 'string.quoted.double.assembly.cc65-directives' + } + # absolut addressing/numbering + { + match: '\\#(\'.\'|[^\\s\']+)' + name: 'constant.numeric.hex.cc65-directives' + } + # hex, prefixed with ampersand($) + { + match: '-?\\$[A-Fa-f0-9]+' + name: 'constant.numeric.hex.cc65-directives' + } + # hex, suffixed with h(h) + { + match: '-?([0-9]+)h' + name: 'constant.numeric.hex.cc65-directives' + } + # binary + { + match: '%[01]+' + name: 'constant.numeric.binary.cc65-directives' + } + # decimal + { + match: '\\b([0-9]+)\\b' + name: 'constant.numeric.decimal.cc65-directives' + } + ] + + # assembler directives + directives: + patterns: [ + # ca65 pseudo variables + { + match: '(\\.)?\\b(?i:\\*|asize|cpu|isize|paramcount|time|version)\\b' + name: 'support.function.pseudo.cc65-directives' + } + # ca65 pseudo functions + { + match: '(\\.)?\\b(?i:addrsize|bank(byte)?|blank|con(cat|st)|(hi|lo)(byte|word)|ident|left|x?match|max|mi[dn]|ref(erenced)?|right|sizeof|strat|sprintf|str(ing|len)|tcount)\\b' + name: 'support.function.pseudo.cc65-directives' + } + # ca65 control commands, A through C + { + match: '(\\.)?\\b(?i:a(8|16)|addr|align|asciiz|assert|autoimport|(bank|hi)bytes|bss|byte?|case|charmap|code|condes|(con|de)structor)\\b' + name: 'storage.modifier.cc65-directives' + } + # ca65 control commands, D and E + { + match: '(\\.)?\\b(?i:data|dbyt|debuginfo|define|delmac(ro)?|def(ined(macro)?)?|dword|else(if)?|end(enum)?|end(enum|if|proc|rep(eat)?|scope|struct|union)?|endmac(ro)?|enum|error|exitmac(ro)?|export(zp)?)\\b' + name: 'storage.modifier.cc65-directives' + } + # ca65 control commands, F through I + { + match: '(\\.)?\\b(?i:faraddr|fatal|feature|f(ile)?opt|forceimport|global(zp)?|i(8|16)|if((n)?blank|const|(n)?def|(n)?ref|p02|p4510|p816|p(s)?c02)?|import(zp)?|inc(bin|lude)|interruptor|ismnem(onic)?)\\b' + name: 'storage.modifier.cc65-directives' + } + # ca65 control commands, L through R + { + match: '(\\.)?\\b(?i:linecont|list(bytes)?|lobytes|local(char)?|macpack|mac(ro)?|org|out|p02|p4510|p816|pagelen(gth)?|pc02|pop(cpu|seg)|proc|psc02|push(cpu|seg)|reloc|repeat|res|rodata)\\b' + name: 'storage.modifier.cc65-directives' + } + # ca65 control commands, S through Z + { + match: '(\\.)?\\b(?i:scope|segment|set(cpu)?|smart|struct|tag|undef(ine)?|union|warning|word|zeropage)\\b' + name: 'storage.modifier.cc65-directives' + } + # CPU constants + { + match: '\\b(CPU_6502|CPU_65SC02|CPU_65C02|CPU_65816|CPU_SWEET16|CPU_HUC6280|CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_65816|CPU_ISET_SWEET16|CPU_ISET_HUC6280|__APPLE2__|__APPLE2ENH__|__ATARI__|__ATARIXL__|__ATMOS__|__BBC__|__C128__|__C16__|__C64__|__CBM__|__CBM510__|__CBM610__|__GEOS__|__GEOS_APPLE__|__GEOS_CBM__|__LUNIX__|__LYNX__|__NES__|__PET__|__PLUS4__|__SIM6502__|__SIM65C02__|__SUPERVISION__|__VIC20__)\\b' + name: 'constant.other.cc65-directives' + } + # Operators + { + match: '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|' + name: 'keyword.operator.cc65-directives' + } + # Operators II + { + match: '(\\.)\\b(?i:and|(bit)?(and|not|or|xor)|mod|shl|shr)\\b' + name: 'keyword.operator.cc65-directives' + } + ] diff --git a/grammars/cc65-toolchain.cson b/grammars/cc65-toolchain.cson index 4aeb1cd..4b4f2ff 100644 --- a/grammars/cc65-toolchain.cson +++ b/grammars/cc65-toolchain.cson @@ -1,139 +1,14 @@ -# Syntax Highlighting for the cc65 toolchain +# Syntax Highlighting for the cc65 toolchain ans 6502 support scopeName: 'source.cc65-toolchain' name: '6502 Assembly (cc65)' # Name shown in Atom Editor grammar selection -# File extensions associated with this package +# File extensions associated with this grammar fileTypes: [ 's' ] +# include all opcodes and directives the toolchain supports patterns: [ - # The 65c02 instruction set - { - include: 'source.65c02-opcodes' - } - # Include the 6502ex op codes - { - include: 'source.6502x-opcodes' - } - # The cc65 toolchain considers everything after a semicolon(;) as comment - { - include: '#comments' - } - # symbols, constants, numbers - { - include: '#symbols' - } - # directives - { - include: '#directives' - } + { include: 'source.65c02-opcodes' } # the 65c02 opcodes, includes the basic 6502 instruction set + { include: 'source.6502x-opcodes' } # extend with 6502X opcodes + { include: 'source.cc65-directives' } # include the directives for the cc65 toolchain ] - -# Repository starts here ------------------------------------------------------ -repository: - - # comments - comments: - patterns: [ - # semicolon comments - { - match: ';.*$' - name: 'comment.line.semicolon.cc65-toolchain' - } - ] - - # symbols - symbols: - patterns: [ - { - begin: '"' - beginCaptures: - 0: - name: 'punctuation.definition.string.begin.cc65-toolchain' - end: '"' - endCaptures: - 0: - name: 'punctuation.definition.string.end.cc65-toolchain' - name: 'string.quoted.double.assembly.cc65-toolchain' - } - # absolut addressing/numbering - { - match: '\\#(\'.\'|[^\\s\']+)' - name: 'constant.numeric.hex.cc65-toolchain' - } - # hex, prefixed with ampersand($) - { - match: '-?\\$[A-Fa-f0-9]+' - name: 'constant.numeric.hex.cc65-toolchain' - } - # hex, suffixed with h(h) - { - match: '-?([0-9]+)h' - name: 'constant.numeric.hex.cc65-toolchain' - } - # binary - { - match: '%[01]+' - name: 'constant.numeric.binary.cc65-toolchain' - } - # decimal - { - match: '\\b([0-9]+)\\b' - name: 'constant.numeric.decimal.cc65-toolchain' - } - ] - - # assembler directives - directives: - patterns: [ - # ca65 pseudo variables - { - match: '(\\.)?\\b(?i:\\*|asize|cpu|isize|paramcount|time|version)\\b' - name: 'support.function.pseudo.cc65-toolchain' - } - # ca65 pseudo functions - { - match: '(\\.)?\\b(?i:addrsize|bank(byte)?|blank|con(cat|st)|(hi|lo)(byte|word)|ident|left|x?match|max|mi[dn]|ref(erenced)?|right|sizeof|strat|sprintf|str(ing|len)|tcount)\\b' - name: 'support.function.pseudo.cc65-toolchain' - } - # ca65 control commands, A through C - { - match: '(\\.)?\\b(?i:a(8|16)|addr|align|asciiz|assert|autoimport|(bank|hi)bytes|bss|byte?|case|charmap|code|condes|(con|de)structor)\\b' - name: 'storage.modifier.cc65-toolchain' - } - # ca65 control commands, D and E - { - match: '(\\.)?\\b(?i:data|dbyt|debuginfo|define|delmac(ro)?|def(ined(macro)?)?|dword|else(if)?|end(enum)?|end(enum|if|proc|rep(eat)?|scope|struct|union)?|endmac(ro)?|enum|error|exitmac(ro)?|export(zp)?)\\b' - name: 'storage.modifier.cc65-toolchain' - } - # ca65 control commands, F through I - { - match: '(\\.)?\\b(?i:faraddr|fatal|feature|f(ile)?opt|forceimport|global(zp)?|i(8|16)|if((n)?blank|const|(n)?def|(n)?ref|p02|p4510|p816|p(s)?c02)?|import(zp)?|inc(bin|lude)|interruptor|ismnem(onic)?)\\b' - name: 'storage.modifier.cc65-toolchain' - } - # ca65 control commands, L through R - { - match: '(\\.)?\\b(?i:linecont|list(bytes)?|lobytes|local(char)?|macpack|mac(ro)?|org|out|p02|p4510|p816|pagelen(gth)?|pc02|pop(cpu|seg)|proc|psc02|push(cpu|seg)|reloc|repeat|res|rodata)\\b' - name: 'storage.modifier.cc65-toolchain' - } - # ca65 control commands, S through Z - { - match: '(\\.)?\\b(?i:scope|segment|set(cpu)?|smart|struct|tag|undef(ine)?|union|warning|word|zeropage)\\b' - name: 'storage.modifier.cc65-toolchain' - } - # CPU constants - { - match: '\\b(CPU_6502|CPU_65SC02|CPU_65C02|CPU_65816|CPU_SWEET16|CPU_HUC6280|CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_65816|CPU_ISET_SWEET16|CPU_ISET_HUC6280|__APPLE2__|__APPLE2ENH__|__ATARI__|__ATARIXL__|__ATMOS__|__BBC__|__C128__|__C16__|__C64__|__CBM__|__CBM510__|__CBM610__|__GEOS__|__GEOS_APPLE__|__GEOS_CBM__|__LUNIX__|__LYNX__|__NES__|__PET__|__PLUS4__|__SIM6502__|__SIM65C02__|__SUPERVISION__|__VIC20__)\\b' - name: 'constant.other.cc65-toolchain' - } - # Operators - { - match: '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|' - name: 'keyword.operator.cc65-toolchain' - } - # Operators II - { - match: '(\\.)\\b(?i:and|(bit)?(and|not|or|xor)|mod|shl|shr)\\b' - name: 'keyword.operator.cc65-toolchain' - } - ] From 90366d7d064ed728067056b356eb96c00c6a77c0 Mon Sep 17 00:00:00 2001 From: Georg Ziegler Date: Thu, 22 Mar 2018 22:03:41 +0100 Subject: [PATCH 4/5] Add WDCTools support --- grammars/6502-opcodes.cson | 10 --- grammars/65c02-opcodes.cson | 5 ++ grammars/cc65-directives.cson | 9 --- grammars/wdc-directives.cson | 122 +++++++++++++++++++++++++++++++++ grammars/wdc-toolchain.cson | 14 ++++ grammars/wdc816-toolchain.cson | 14 ++++ settings/language-65asm.cson | 36 +++++----- 7 files changed, 173 insertions(+), 37 deletions(-) create mode 100644 grammars/wdc-directives.cson create mode 100644 grammars/wdc-toolchain.cson create mode 100644 grammars/wdc816-toolchain.cson diff --git a/grammars/6502-opcodes.cson b/grammars/6502-opcodes.cson index 9461e41..f0a9a1a 100644 --- a/grammars/6502-opcodes.cson +++ b/grammars/6502-opcodes.cson @@ -23,13 +23,3 @@ repository: name: 'keyword.mnemonic.6502.6502-opcodes' } ] -# 'M65816': -# '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' -# 'name': 'keyword.mnemonic.65816' -# 'M65816_alias': -# 'match': '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b' -# 'name': 'keyword.mnemonic.65816_alias' -# 'M65C02': -# 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' -# 'name': 'keyword.mnemonic.65c02' -# 'scopeName': 'source.assembly.6502' diff --git a/grammars/65c02-opcodes.cson b/grammars/65c02-opcodes.cson index e0ecbfe..35b5980 100644 --- a/grammars/65c02-opcodes.cson +++ b/grammars/65c02-opcodes.cson @@ -25,4 +25,9 @@ repository: match: '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' name: 'keyword.mnemonic.65c02.65c02-opcodes' } + # additional opcodes for WDC chips + { + match: '\\b(?i:(BBR|BBS|RMB|SMB)[0-7])\\b' + name: 'keyword.mnemonic.65c02.65c02-opcodes' + } ] diff --git a/grammars/cc65-directives.cson b/grammars/cc65-directives.cson index 290544a..81c33ca 100644 --- a/grammars/cc65-directives.cson +++ b/grammars/cc65-directives.cson @@ -3,15 +3,6 @@ scopeName: 'source.cc65-directives' patterns: [ - # # The 65c02 instruction set - # { - # include: 'source.65c02-opcodes' - # } - # # Include the 6502ex op codes - # { - # include: 'source.6502x-opcodes' - # } - # The cc65 toolchain considers everything after a semicolon(;) as comment { include: '#comments' } diff --git a/grammars/wdc-directives.cson b/grammars/wdc-directives.cson new file mode 100644 index 0000000..9833f96 --- /dev/null +++ b/grammars/wdc-directives.cson @@ -0,0 +1,122 @@ +# Syntax Highlighting for the Western Design Center toolchain directives + +scopeName: 'source.wdc-directives' + +patterns: [ + { + include: '#comments' + } + # symbols, constants, numbers + { + include: '#symbols' + } + # directives + { + include: '#directives' + } +] + +# Repository starts here ------------------------------------------------------ +repository: + + # comments + comments: + patterns: [ + # semicolon comments + { + match: ';.*$' + name: 'comment.line.semicolon.wdc-toolchain' + } + ] + + # symbols + symbols: + patterns: [ + # strings + { + begin: '"' + beginCaptures: + 0: + name: 'punctuation.definition.string.begin.wdc-toolchain' + end: '"' + endCaptures: + 0: + name: 'punctuation.definition.string.end.wdc-toolchain' + name: 'string.quoted.double.assembly.wdc-toolchain' + } + # absolut addressing/numbering + { + match: '\\#(\'.\'|[^\\s\']+)' + name: 'constant.numeric.hex.wdc-toolchain' + } + # hex, prefixed with ampersand($) + { + match: '-?\\$[A-Fa-f0-9]+' + name: 'constant.numeric.hex.wdc-toolchain' + } + # hex, suffixed with h(h) + { + match: '-?([0-9]+)h' + name: 'constant.numeric.hex.wdc-toolchain' + } + # binary prefixed with % + { + match: '%[01]+' + name: 'constant.numeric.binary.wdc-toolchain' + } + # binary suffixed with B + { + match: '[01]+(?i:b)' + name: 'constant.numeric.binary.wdc-toolchain' + } + # octal and decimal + { + match: '\\b([0-9]+(d|o|q)?)\\b' + name: 'constant.numeric.decimal.wdc-toolchain' + } + ] + + # assembler directives + directives: + patterns: [ + # File and Symbol control + { + match: '\\b(?i:append|include|insert|end(s|mod)?|exit|module|section|org|origin|equ(al)?|gequ|defl|set|var|extern(al|s)?|xref|globals?|public|xdef|message|messg|efunc|incdebug)\\b' + name: 'support.function.pseudo.wdc-toolchain' + } + # Parsing control + { + match: '\\b(?i:case|chip|chkimmed|comment|dbreg|dpage|long[ai]|radix|spaces|llchar|bit7|mask|squote|twochar|asc(ii)?|fcc|date|da|d?byte|d(ef)?b|fcb|string|dc|d(ef)?w|fdb|l?word|dl|longw?|blk[blw]|defs|ds(a|b|l|w)?|rmb|apwdc|float|double)\\b' + name: 'support.function.pseudo.wdc-toolchain' + } + # Macro control + { + match: '\\b(?i:macro|endm|macend|argchk|macfirst|macdelim|macexit|ifma|ifnma|rept|endr)\\b' + name: 'support.function.pseudo.wdc-toolchain' + } + # Conditional control + { + match: '\\b(?i:end(c|if)?|cond|ifn?(false|true|z|abs|rel|def|diff|same|ext|page0)?|if(long|short)[ai]|ifmatch|else)\\b' + name: 'keyword.control.conditional.wdc-toolchain' + } + # Listing control + { + match: '\\b(?i:pl|pw|top|heading|nam|title|s?ttl|subtitle|subttl|eject|page?|(no?)?list|(inc|asc|cond|m(ac)?|mn)list|pass1)\\b' + name: 'support.function.pseudo.wdc-toolchain' + } + # Pre-defined sections + { + match: '\\b(?i:page0|code|(k|u)?data)\\b' + name: 'constant.other.wdc-toolchain' + } + # Operators + { + match: '!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:|\\|\\|' + name: 'keyword.operator.wdc-toolchain' + } + # Operators II + { + match: '\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b' + name: 'keyword.operator.wdc-toolchain' + } + ] diff --git a/grammars/wdc-toolchain.cson b/grammars/wdc-toolchain.cson new file mode 100644 index 0000000..ec03df5 --- /dev/null +++ b/grammars/wdc-toolchain.cson @@ -0,0 +1,14 @@ +# Syntax Highlighting for the Western Design Center toolchain and 6502 support +# TODO: extra addressing modes, chip point prefix, * comments + +scopeName: 'source.wdc-toolchain' +name: '6502 Assembly (WDCTools)' # Name shown in Atom Editor grammar selection +# File extensions associated with this grammar +fileTypes: [ + 's' +] +# include all opcodes and directives the toolchain supports +patterns: [ + { include: 'source.65c02-opcodes' } # the 65c02 opcodes, includes the basic 6502 instruction set + { include: 'source.wdc-directives' } # include the directives of the WDCxAS assemblers +] diff --git a/grammars/wdc816-toolchain.cson b/grammars/wdc816-toolchain.cson new file mode 100644 index 0000000..c997c13 --- /dev/null +++ b/grammars/wdc816-toolchain.cson @@ -0,0 +1,14 @@ +# Syntax Highlighting for the Western Design Center toolchain and 65816 support + +scopeName: 'source.wdc816-toolchain' +name: '65816 Assembly (WDCTools)' # Name shown in Atom Editor grammar selection +# File extensions associated with this grammar +fileTypes: [ + 's' +] +# include all opcodes and directives the toolchain supports +patterns: [ + { include: 'source.65816-opcodes' } # the 65c02 opcodes, includes the basic 65c02 instruction set + { include: 'source.65816-aliases' } # Opcode aliases for the 65816 + { include: 'source.wdc-directives' } # include the directives of the WDCxAS assemblers +] diff --git a/settings/language-65asm.cson b/settings/language-65asm.cson index 137d861..9908f2e 100644 --- a/settings/language-65asm.cson +++ b/settings/language-65asm.cson @@ -1,18 +1,18 @@ -# '.source.assembly': -# 'editor': -# 'commentStart': ';' -# '.source.assembly.6502.edasm': -# 'editor': -# 'foldEndPattern': '\\b(?i:DEND|FIN)\\b' -# '.source.assembly.65816.mpw': -# 'editor': -# 'foldEndPattern': '\\b(?i:ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|ENDR|ENDSTACK|ENDWITH|ENDM|ENDMACRO|MEND)\\b' -# '.source.assembly.65816.merlin': -# 'editor': -# 'foldEndPattern': '\\b(?i:DEND|FIN)\\b|<<<|--\\^' -# '.source.assembly.65816.ninjaforce': -# 'editor': -# 'foldEndPattern': '(\\^\\^\\^|\\<\\<\\<)' -# '.source.assembly.65816.orcam': -# 'editor': -# 'foldEndPattern': '\\b(?i:END)\\b' +'.source.assembly': + 'editor': + 'commentStart': ';' +'.source.assembly.6502.edasm': + 'editor': + 'foldEndPattern': '\\b(?i:DEND|FIN)\\b' +'.source.assembly.65816.mpw': + 'editor': + 'foldEndPattern': '\\b(?i:ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|ENDR|ENDSTACK|ENDWITH|ENDM|ENDMACRO|MEND)\\b' +'.source.assembly.65816.merlin': + 'editor': + 'foldEndPattern': '\\b(?i:DEND|FIN)\\b|<<<|--\\^' +'.source.assembly.65816.ninjaforce': + 'editor': + 'foldEndPattern': '(\\^\\^\\^|\\<\\<\\<)' +'.source.assembly.65816.orcam': + 'editor': + 'foldEndPattern': '\\b(?i:END)\\b' From ffc9bef8f8dc34070f286a6d133b9a60f5894481 Mon Sep 17 00:00:00 2001 From: Georg Ziegler Date: Thu, 22 Mar 2018 22:08:43 +0100 Subject: [PATCH 5/5] Add WDCTools support --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e285fed..0d92eca 100755 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ config.cson (`ctrl+shift+p` -> config): } ``` -See first line in grammar files for names. +See last line in grammar files for names. # Contributors