Merge pull request #9 from georgjz/pullrequest

ACME fix, scope improvements
This commit is contained in:
Matthew Callis 2018-06-04 09:02:30 -07:00 committed by GitHub
commit ebf3af2037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 195 additions and 94 deletions

View File

@ -1,42 +0,0 @@
'fileTypes': []
'name': '65816 Assembly'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#M65816L'
}
{
'include': '#M65816'
}
]
'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'
'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'
'M65816L':
'match': '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b'
'name': 'keyword.mnemonic.65816.long'
'M65C02':
'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b'
'name': 'keyword.mnemonic.65c02'
'binary_number':
'match': '%[01]+'
'name': 'constant.numeric.binary'
'decimal_number':
'match': '\\b([0-9]+)\\b'
'name': 'constant.numeric.decimal'
'hex_number':
'match': '\\$[A-Fa-f0-9]+'
'name': 'constant.numeric.hex'
'octal_number':
'match': '@([0-7]+)\\b'
'name': 'constant.numeric.octal'
'scopeName': 'source.assembly.65816'

View File

@ -0,0 +1,65 @@
# Generic 65816 grammar with semicolon comments
scopeName: 'source.assembly.65816.65816-generic'
fileTypes: []
name: '65816 Assembly'
patterns: [
{ include: 'source.65816-opcodes' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes
{ include: 'source.65816l-opcodes' } # extend with 6502X opcodes
{ include: '#comments' }
{ include: '#symbols' }
]
# Repository starts here ------------------------------------------------------
repository:
# comments
comments:
patterns: [
# semicolon comments
{
match: ';.*$'
name: 'comment.line.semicolon.65816-generic'
}
]
# symbols
symbols:
patterns: [
{
begin: '"'
beginCaptures:
0:
name: 'punctuation.definition.string.begin.65816-generic'
end: '"'
endCaptures:
0:
name: 'punctuation.definition.string.end.65816-generic'
name: 'string.quoted.double.assembly.65816-generic'
}
# absolut address/number
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.65816-generic'
}
# hex, prefixed with ampersand($)
{
match: '-?\\$[A-Fa-f0-9]+'
name: 'constant.numeric.hex.65816-generic'
}
# hex, suffixed with h(h)
{
match: '-?([0-9]+)h'
name: 'constant.numeric.hex.65816-generic'
}
# binary
{
match: '%[01]+'
name: 'constant.numeric.binary.65816-generic'
}
# decimal
{
match: '\\b([0-9]+)\\b'
name: 'constant.numeric.decimal.65816-generic'
}
]

View File

@ -0,0 +1,23 @@
# Pseudo opcodes for the 65816 used by some assemblers
scopeName: 'source.65816l-opcodes'
patterns: [
# The 65816 instruction set
{
include: '#mnemonics-65816l'
}
]
# Respository starts here -----------------------------------------------------
repository:
# 65816 instruction set
'mnemonics-65816l':
patterns: [
# mnemonics
{
match: '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b'
name: 'keyword.mnemonic.65816.65816l-opcodes'
}
]

View File

@ -0,0 +1,65 @@
# Generic 65C02 grammar with semicolon comments
scopeName: 'source.assembly.6502.65c02-generic'
fileTypes: []
name: '6502 Assembly'
patterns: [
{ include: 'source.65c02-opcodes' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes
{ include: 'source.6502x-opcodes' }
{ include: '#comments' }
{ include: '#symbols' }
]
# Repository starts here ------------------------------------------------------
repository:
# comments
comments:
patterns: [
# semicolon comments
{
match: ';.*$'
name: 'comment.line.semicolon.65c02-generic'
}
]
# symbols
symbols:
patterns: [
{
begin: '"'
beginCaptures:
0:
name: 'punctuation.definition.string.begin.65c02-generic'
end: '"'
endCaptures:
0:
name: 'punctuation.definition.string.end.65c02-generic'
name: 'string.quoted.double.assembly.65c02-generic'
}
# absolut address/number
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.65c02-generic'
}
# hex, prefixed with ampersand($)
{
match: '-?\\$[A-Fa-f0-9]+'
name: 'constant.numeric.hex.65c02-generic'
}
# hex, suffixed with h(h)
{
match: '-?([0-9]+)h'
name: 'constant.numeric.hex.65c02-generic'
}
# binary
{
match: '%[01]+'
name: 'constant.numeric.binary.65c02-generic'
}
# decimal
{
match: '\\b([0-9]+)\\b'
name: 'constant.numeric.decimal.65c02-generic'
}
]

View File

@ -72,22 +72,27 @@ repository:
patterns: [
# File and Symbol control
{
match: '\\b\!(?i:source|src|eof|endoffile|pseudopc|zn|zone|set|to|bin(ary)?|sl|warn|error|serious)\\b'
match: '!\\b(?i:source|src|eof|endoffile|realpc|pseudopc|zn|(sub)?zone|set|to|bin(ary)?|sl|symbollist|warn|error|serious|initmem|cbm|addr(ess)?)\\b'
name: 'support.function.pseudo.acme'
}
# Parsing control
{
match: '\\b\!(?i:cpu|al|as|rl|rs|8|by|byte|16|wo|word|24|32|h|hex|fi|fill|align|skip|ct|convtab|tx|text|pet|scr|scrxor|raw)\\b'
match: '!\\b(?i:cpu|al|as|rl|rs|08|by|byte|([bl]e)?(16|24|32)|wo|word|h|hex|fi|fill|align|skip|ct|convtab|tx|text|pet|scr|scrxor|raw)\\b'
name: 'support.function.pseudo.acme'
}
# Macro control
{
match: '\\b(?i:\!macro|\+[a-zA-Z0-9)\\b'
match: '(?i:!\\bmacro|\\+[a-zA-Z0-9])\\b'
name: 'support.function.pseudo.acme'
}
# Conditional control
{
match: '\\b(?i:\!if|else|\!if(n)?def|\!for|\!do|while|until)\\b'
match: '!\\b(?i:if|if(n)?def|for|do|while|until)\\b'
name: 'keyword.control.conditional.acme'
}
# Conditional control II
{
match: '\\b(?i:else|while|until)\\b'
name: 'keyword.control.conditional.acme'
}
# Operators

View File

@ -1,13 +1,14 @@
# Syntax Highlighting for the cc65 toolchain and 65816 support
scopeName: 'source.cc65-816-toolchain'
scopeName: 'source.assembly.65816.cc65-816-toolchain'
name: '65816 Assembly (cc65)' # 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' } # 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
{ 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
]

View File

@ -3,17 +3,9 @@
scopeName: 'source.cc65-directives'
patterns: [
{
include: '#comments'
}
# symbols, constants, numbers
{
include: '#symbols'
}
# directives
{
include: '#directives'
}
{ include: '#comments' } # comments
{ include: '#symbols' } # symbols, constants, numbers
{ include: '#directives' } # cc65 assembler directives
]
# Repository starts here ------------------------------------------------------
@ -43,7 +35,7 @@ repository:
name: 'punctuation.definition.string.end.cc65-directives'
name: 'string.quoted.double.assembly.cc65-directives'
}
# absolut addressing/numbering
# absolut address/number
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.cc65-directives'

View File

@ -1,6 +1,6 @@
# Syntax Highlighting for the cc65 toolchain ans 6502 support
scopeName: 'source.cc65-toolchain'
scopeName: 'source.assembly.6502.cc65-toolchain'
name: '6502 Assembly (cc65)' # Name shown in Atom Editor grammar selection
# File extensions associated with this grammar
fileTypes: [
@ -8,7 +8,7 @@ fileTypes: [
]
# include all opcodes and directives the toolchain supports
patterns: [
{ 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
{ 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
]

View File

@ -0,0 +1,14 @@
# Syntax Highlighting for the Western Design Center toolchain and 65816 support
scopeName: 'source.assembly.65816.wdc-816-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
]

View File

@ -3,17 +3,9 @@
scopeName: 'source.wdc-directives'
patterns: [
{
include: '#comments'
}
# symbols, constants, numbers
{
include: '#symbols'
}
# directives
{
include: '#directives'
}
{ include: '#comments' }
{ include: '#symbols' } # symbols, constants, numbers
{ include: '#directives' }
]
# Repository starts here ------------------------------------------------------

View File

@ -1,7 +1,7 @@
# Syntax Highlighting for the Western Design Center toolchain and 6502 support
# TODO: extra addressing modes, chip point prefix, * comments
scopeName: 'source.wdc-toolchain'
scopeName: 'source.assembly.6502.wdc-toolchain'
name: '6502 Assembly (WDCTools)' # Name shown in Atom Editor grammar selection
# File extensions associated with this grammar
fileTypes: [
@ -9,6 +9,6 @@ fileTypes: [
]
# 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
{ include: 'source.65c02-opcodes' } # the 65c02 opcodes, includes the basic 6502 instruction set
{ include: 'source.wdc-directives' } # include the directives of the WDCxAS assemblers
]

View File

@ -1,14 +0,0 @@
# 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
]