Squash develope commits into one

This commit is contained in:
Georg Ziegler 2018-03-20 20:54:24 +01:00
parent 475c022a2e
commit 376a1e0f55
8 changed files with 267 additions and 121 deletions

View File

@ -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

View File

@ -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'

View File

@ -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'

View File

@ -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'
}
]

View File

@ -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'
}
]

View File

@ -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'
}
]

View File

@ -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'
}
]

View File

@ -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'