Compare commits

...

47 Commits

Author SHA1 Message Date
Matthew Callis 765fce9827
Prepare v10.5.0 release 2021-02-08 15:07:05 -08:00
Matthew Callis e387111185
Merge pull request #19 from ProbablyNotArtyom/master
Various fixes for the Kick Assembler grammar
2021-02-08 15:03:58 -08:00
Matthew Callis ada325129d
Merge pull request #18 from secondsun/patch-1
Fix typo in cc65-toolchain.cson
2021-02-08 15:03:14 -08:00
ProbablyNotArtyom ca009b986b Various regex fixes for the Kick Assembler grammar
* Removed all remaining references to the 'merlin' grammar
 * Labels with trailing numbers are now detected as labels
 * Branches to positional labels are detected properly now
2020-10-01 04:25:08 -04:00
Hoyt Summers Pittman aa5faf999f
Fix typo in cc65-toolchain.cson 2020-07-11 13:49:39 -04:00
Matthew Callis 32ddd31469
Update CHANGELOG.md 2020-01-27 12:40:47 -08:00
Matthew Callis 3645d31d58
Prepare v10.4.0 release 2020-01-27 12:40:23 -08:00
Matthew Callis 118052ebc8
Update CHANGELOG 2020-01-27 12:39:27 -08:00
Matthew Callis 4a5733826e
Update README 2020-01-27 12:38:27 -08:00
Matthew Callis 6e4108ca91
Merge pull request #17 from michaellass/fix-operator-regex
Fix operator regex for ACME grammar (again)
2020-01-27 12:36:47 -08:00
Michael Lass 0c3e7c9e25 Fix operator regex for ACME grammar (again)
Currently, the regex causes the following error:

Uncaught Error: target of repeat operator is not specified

```
At /usr/lib/atom/node_modules/first-mate/lib/scanner.js:31

Error: target of repeat operator is not specified
    at Scanner.module.exports.Scanner.createScanner (/usr/lib/atom/node_modules/first-mate/lib/scanner.js:31:24)
    at Scanner.module.exports.Scanner.getScanner (/usr/lib/atom/node_modules/first-mate/lib/scanner.js:37:31)
    at Scanner.module.exports.Scanner.findNextMatch (/usr/lib/atom/node_modules/first-mate/lib/scanner.js:56:22)
    at Rule.module.exports.Rule.findNextMatch (/usr/lib/atom/node_modules/first-mate/lib/rule.js:98:28)
    at Rule.module.exports.Rule.getNextTags (/usr/lib/atom/node_modules/first-mate/lib/rule.js:154:21)
    at Grammar.module.exports.Grammar.tokenizeLine (/usr/lib/atom/node_modules/first-mate/lib/grammar.js:162:44)
    at TextMateLanguageMode.buildTokenizedLineForRowWithText (/usr/lib/atom/src/text-mate-language-mode.js:503:46)
    at TextMateLanguageMode.buildTokenizedLineForRow (/usr/lib/atom/src/text-mate-language-mode.js:488:17)
    at TextMateLanguageMode.tokenizeNextChunk (/usr/lib/atom/src/text-mate-language-mode.js:340:41)
    at _.defer (/usr/lib/atom/src/text-mate-language-mode.js:324:57)
    at /usr/lib/atom/node_modules/underscore/underscore.js:768:19
```

Fix the regex by applying the following modifications:
* use double backslashes to escape special characters
* insert missing * into regex

While here, also give the pattern a .acme suffix as all the other have.
2020-01-18 23:35:06 +01:00
Matthew Callis 2dcf07e67b
Prepare v10.3.0 release 2019-11-13 19:37:41 -08:00
Matthew Callis e7976a5a95
Fix issue in publishing 2019-11-13 19:37:30 -08:00
Matthew Callis 124e6531f4
Prepare v10.1.0 release 2019-11-13 19:36:37 -08:00
Matthew Callis a0db8c9fbd
Merge pull request #16 from ProbablyNotArtyom/master
Add KickAssembler syntax
2019-11-13 19:34:18 -08:00
ProbablyNotArtyom cbcc0bfce6 Added KickAssembler to the README
Added KickAssembler credits to the README
2019-11-13 06:35:47 -05:00
ProbablyNotArtyom 707b9c8bd3 Added KickAssembler grammar 2019-11-13 06:32:10 -05:00
Matthew Callis c5ff13055f
Merge pull request #15 from MatthewCallis/ACME
Fix bug in Acme grammar with arithmetic operators
2019-08-29 15:51:54 -07:00
Matthew Callis a198b529b7
Fix bug in Acme grammar with arithmetic operators 2019-08-29 15:50:55 -07:00
Matthew Callis 191902076a
Prepare 10.0.0 release 2018-12-19 12:18:46 -08:00
Matthew Callis c1b48c5732
v10 2018-12-19 12:18:08 -08:00
Matthew Callis 0a367c9924
Merge pull request #13 from georgjz/master
Add ASM6f support, closes #12
2018-12-19 12:13:46 -08:00
Georg Ziegler 5ad9fa0be5 Merge branch 'asm6' 2018-10-19 16:35:29 +02:00
Georg Ziegler f56e593d02 Update README 2018-10-19 16:34:51 +02:00
Georg Ziegler 2578cfb4e3 Refactor and add file extension 2018-10-19 16:27:18 +02:00
Georg Ziegler dafc148662 Add missing operators and illegal opcodes 2018-10-19 16:21:04 +02:00
Georg Ziegler 1cbcd550e1 Add support for asm6 assembler 2018-10-19 16:14:05 +02:00
Matthew Callis 032e7d76d7
Create CHANGELOG.md 2018-06-21 10:47:11 -07:00
Matthew Callis 8791a59ecb
Prepare 9.0.0 release 2018-06-21 10:42:32 -07:00
Matthew Callis ffbb1c698e
Merge pull request #11 from MatthewCallis/ACME-UPDATES
Updated ACME grammar from GoDot
2018-06-21 10:40:04 -07:00
Matthew Callis b4a88e0a42
Updated ACME grammar from GoDot 2018-06-21 10:39:19 -07:00
Matthew Callis a32c1f73a2
Merge pull request #10 from georgjz/master
Fix DASM and Merlin, add Asar, improve cc65
2018-06-21 10:37:18 -07:00
Georg Ziegler d7c010e8aa Add SPC-700 and SuperFX opcodes 2018-06-21 06:40:54 +02:00
Georg Ziegler 194a96a3cd Add missing keyword 2018-06-12 17:22:39 +02:00
Georg Ziegler fad43e3b4a Merge branch 'develop' 2018-06-12 09:52:03 +02:00
Georg Ziegler bc4ce09e84 Add asar support 2018-06-12 09:51:53 +02:00
Georg Ziegler 1e605edeb4 Add missing commands, opcodes, constants 2018-06-12 07:55:37 +02:00
Georg Ziegler b23fafac4a Improve cc65 support with new grammar for linker config files 2018-06-12 07:02:05 +02:00
Georg Ziegler eefb3ddffa Remove duplicate files 2018-06-08 03:31:19 +02:00
Georg Ziegler 3394902046 Merge branch 'merlin' 2018-06-08 02:58:45 +02:00
Georg Ziegler 9e1c3129eb Merge branch 'develop' 2018-06-08 02:58:22 +02:00
Georg Ziegler 1687bd1b93 Improve Merlin grammar 2018-06-08 02:57:54 +02:00
Georg Ziegler 1ce19430cf Fix DASM grammar 2018-06-07 20:54:11 +02:00
Georg Ziegler 42530f66bc DASM: Add opcodes and comments 2018-06-07 18:24:53 +02:00
Georg Ziegler 28079336e1 Fix hex numbers with suffix 'h' 2018-06-07 17:15:47 +02:00
Georg Ziegler 10e34aca94 New files for Merlin grammar 2018-06-07 16:39:14 +02:00
Georg Ziegler 52375b7e6e Merge branch 'master' into develop 2018-06-04 21:41:19 +02:00
19 changed files with 1220 additions and 351 deletions

24
CHANGELOG.md Normal file
View File

@ -0,0 +1,24 @@
# v10.4.0
* Fix operator regex for ACME grammar (again) [#17](https://github.com/MatthewCallis/language-65asm/pull/17)
# v10.0.0
* Add support for asm6 assembler
# v9.0.0
Added https://github.com/georgjz as a collaborator 🎉
* Updated ACME Grammar (https://github.com/MatthewCallis/language-65asm/pull/11)
* Fix DASM & Merlin, add ASAR, improve CC65 (https://github.com/MatthewCallis/language-65asm/pull/10):
* Added a new grammar to support [Asar Assembler](https://github.com/RPGHacker/asar)
* Added SPC700 and SuperFX opcodes (extracted from the SNES cc65 grammar)
* DASM and Merlin should work now
* cc65
* Added some missing commands and constants
* Changed some scopes to improve readability
* Added a new grammar for the linker config files ld65 uses
* Updated the link in README.md
* Fixed hex numbers with a trailing h
* Add missing commands to WDC tools

View File

@ -3,7 +3,9 @@
Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with extra support for various compilers:
- [ACME Crossassembler](https://sourceforge.net/projects/acme-crossass/)
- [cc65 (SNES Syntax: 65816, SPC700, SuperFX)](http://oliverschmidt.github.io/cc65/)
- [Asar SNES Assembler](https://github.com/RPGHacker/asar)
- [ASM6f](https://github.com/freem/asm6f) (support for NES emulator Mesen)
- [cc65 (SNES Syntax: 65816, SPC700, SuperFX)](https://github.com/cc65/cc65)
- [DASM](http://dasm-dillon.sourceforge.net/) (6502)
- [EDASM](https://archive.org/details/EDASM-ProDOS_Assembler_Tools_Manual)
- [Merlin](http://en.wikipedia.org/wiki/Merlin_(assembler))
@ -12,6 +14,7 @@ Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with ex
- [ORCA/M](http://www.byteworks.us/Byte_Works/Products.html)
- [WLA-DX](http://www.villehelin.com/wla.html)
- [WTCTools by Western Design Center](http://westerndesigncenter.com/wdc/tools.cfm)
- [Kick Assembler](http://theweb.dk/KickAssembler/Main.html#frontpage)
Originally [converted](http://atom.io/docs/latest/converting-a-text-mate-bundle)
from the various other TextMate bundles:
@ -54,3 +57,5 @@ See last line in grammar files for names.
- [ARM9](https://github.com/ARM9)
- [georgjz](https://github.com/georgjz)
- [GoDot](http://www.godot64.de/)
- [Carson Herrington](https://github.com/ProbablyNotArtyom)
- [Michael Lass](https://github.com/michaellass)

114
coffeelint.json Normal file
View File

@ -0,0 +1,114 @@
{
"coffeescript_error": {
"level": "error"
},
"arrow_spacing": {
"name": "arrow_spacing",
"level": "warn"
},
"no_tabs": {
"name": "no_tabs",
"level": "error"
},
"no_trailing_whitespace": {
"name": "no_trailing_whitespace",
"level": "error",
"allowed_in_comments": false,
"allowed_in_empty_lines": true
},
"max_line_length": {
"name": "max_line_length",
"value": 128,
"level": "ignore",
"limitComments": true
},
"line_endings": {
"name": "line_endings",
"level": "warn",
"value": "unix"
},
"no_trailing_semicolons": {
"name": "no_trailing_semicolons",
"level": "error"
},
"indentation": {
"name": "indentation",
"value": 2,
"level": "error"
},
"camel_case_classes": {
"name": "camel_case_classes",
"level": "error"
},
"colon_assignment_spacing": {
"name": "colon_assignment_spacing",
"level": "ignore",
"spacing": {
"left": 0,
"right": 0
}
},
"no_implicit_braces": {
"name": "no_implicit_braces",
"level": "ignore",
"strict": false
},
"no_plusplus": {
"name": "no_plusplus",
"level": "ignore"
},
"no_throwing_strings": {
"name": "no_throwing_strings",
"level": "error"
},
"no_backticks": {
"name": "no_backticks",
"level": "error"
},
"no_implicit_parens": {
"name": "no_implicit_parens",
"level": "ignore"
},
"no_empty_param_list": {
"name": "no_empty_param_list",
"level": "warn"
},
"no_stand_alone_at": {
"name": "no_stand_alone_at",
"level": "warn"
},
"space_operators": {
"name": "space_operators",
"level": "warn"
},
"duplicate_key": {
"name": "duplicate_key",
"level": "error"
},
"empty_constructor_needs_parens": {
"name": "empty_constructor_needs_parens",
"level": "warn"
},
"cyclomatic_complexity": {
"name": "cyclomatic_complexity",
"value": 10,
"level": "ignore"
},
"newlines_after_classes": {
"name": "newlines_after_classes",
"value": 3,
"level": "ignore"
},
"no_unnecessary_fat_arrows": {
"name": "no_unnecessary_fat_arrows",
"level": "warn"
},
"missing_fat_arrows": {
"name": "missing_fat_arrows",
"level": "ignore"
},
"non_empty_constructor_needs_parens": {
"name": "non_empty_constructor_needs_parens",
"level": "ignore"
}
}

View File

@ -1,65 +1,112 @@
'fileTypes': []
'foldingStartMarker': '/\\*\\*|\\{\\s*$'
'foldingStopMarker': '\\*\\*/|^\\s*\\}'
'name': '6502 Assembly (DASM)'
'patterns': [
{
'match': '\\b(adc|and|asl|bit|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|sbc|sec|sed|sei|sta|stx|sty|tax|txa|tay|tya|tsx|txs)\\b'
'name': 'keyword'
}
{
'match': '\\b(bcc|bcs|beq|bmi|bne|bpl|brk|bvc|bvs|jmp|jsr|rti|rts)\\b'
'name': 'keyword.control'
}
{
'captures':
'1':
'name': 'punctuation.definition.comment'
'match': '(;).*$\\n?'
'name': 'comment.line.semicolon'
}
{
'match': '\\b(SET|WORD|BYTE|HEX)\\b'
'name': 'storage.type'
}
{
'match': '\\b(ALIGN)\\b'
'name': 'storage.modifier'
}
{
'match': '\\b(REPEAT|REPEND|MAC|ENDM|SUBROUTINE)\\b'
'name': 'support.function'
}
{
'match': '\\b(processor|org)\\b'
'name': 'constant.language'
}
{
'begin': '"'
'end': '"'
'name': 'string.quoted.double.untitled'
'patterns': [
# Syntax highlighting for the DASM macro assembler
scopeName: 'source.assembly.6502.dasm'
fileTypes: []
name: '6502 Assembly (DASM)'
patterns: [
{ include: 'source.6502-opcodes' }
{ include: '#comments' }
{ include: '#symbols' }
{ include: '#directives' }
]
# Repository starts here ------------------------------------------------------
repository:
# comments
comments:
patterns: [
# semicolon comments
{
'match': '\\\\.'
'name': 'constant.character.escape.untitled'
match: ';.*$'
name: 'comment.line.semicolon.dasm'
}
]
# symbols
symbols:
patterns: [
# strings
{
begin: '"'
beginCaptures:
0:
name: 'punctuation.definition.string.begin.dasm'
end: '"'
endCaptures:
0:
name: 'punctuation.definition.string.end.dasm'
name: 'string.quoted.double.dasm'
}
# global labels
{
captures:
1:
name: 'entity.name.function.label.dasm'
match: '\\b([A-Za-z0-9_]+):'
name: 'meta.function.label.dasm'
}
# local labels
{
captures:
1:
name: 'entity.name.function.label.dasm'
match: '\\.\\b([A-Za-z0-9_]+):'
name: 'meta.function.label.dasm'
}
# absolut addressing/numbers
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.dasm'
}
# hex, prefixed with dollar sign($)
{
match: '-?\\$\\b[a-fA-F0-9]+\\b'
name: 'constant.numeric.hex.dasm'
}
# octal, prefixed with zero(0)
{
match: '-?\\b0[1-7]+\\b'
name: 'constant.numeric.octal.dasm'
}
# binary
{
match: '%[01]+'
name: 'constant.numeric.binary.65816-generic'
}
# decimal
{
match: '\\b([0-9]+)\\b'
name: 'constant.numeric.decimal.65816-generic'
}
]
# directives
directives:
patterns: [
# file and symbol control
{
match: '\\b(?i:seg(\\.u)?|include|incbin|incdir|hex|err|r?org|processor|echo|rend|align|subroutine)\\b'
name: 'support.function.pseudo.dasm'
}
# data control
{
match: '\\b(?i:d[csv](.bwl)?|hex|eq[um]|set|list\\s(on|off))\\b'
name: 'support.function.pseudo.dasm'
}
# data control II
{
match: '\\.\\b(?i:byte|word)\\b'
name: 'support.function.pseudo.dasm'
}
# Macro control
{
match: '\\b(?i:mac|endm|mexit)\\b'
name: 'support.function.pseudo.acme'
}
# Conditional control
{
match: '\\b(?i:ifn?const|if|else|e(nd)?if|repeat|repend)\\b'
name: 'keyword.control.conditional.acme'
}
]
}
{
'match': '^[A-Za-z_][A-Za-z0-9_]*'
'name': 'entity.name.label'
}
{
'match': '^\\.[A-Za-z_][A-Za-z0-9_]*'
'name': 'entity.name.label.local'
}
{
'match': '#?\\$[0-9a-fA-F]+'
'name': 'constant.numeric.hex'
}
{
'match': '{[0-9]+}'
'name': 'variable.parameter.macro'
}
]
'scopeName': 'source.assembly.6502.dasm'

View File

@ -5,7 +5,7 @@ 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: 'source.65816l-opcodes' } # extend with 65816L opcodes
{ include: '#comments' }
{ include: '#symbols' }
]
@ -35,21 +35,21 @@ repository:
endCaptures:
0:
name: 'punctuation.definition.string.end.65816-generic'
name: 'string.quoted.double.assembly.65816-generic'
name: 'string.quoted.double.65816-generic'
}
# absolut address/number
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.65816-generic'
}
# hex, prefixed with ampersand($)
# hex, prefixed with dollar sign($)
{
match: '-?\\$[A-Fa-f0-9]+'
match: '-?\\$\\b[a-fA-F0-9]+\\b'
name: 'constant.numeric.hex.65816-generic'
}
# hex, suffixed with h(h)
{
match: '-?([0-9]+)h'
match: '-?([a-fA-F0-9]+)h'
name: 'constant.numeric.hex.65816-generic'
}
# binary

View File

@ -0,0 +1,23 @@
# Pseudo opcodes for the 65816 used by some assemblers
scopeName: 'source.65816alt-opcodes'
patterns: [
# The 65816 instruction set
{
include: '#mnemonics-65816alt'
}
]
# Respository starts here -----------------------------------------------------
repository:
# 65816 instruction set
'mnemonics-65816alt':
patterns: [
# mnemonics
{
match: '\\b(?i:tas|tsa|swa|tad|tda|blt|bge)\\b'
name: 'keyword.mnemonic.65816.65816alt-opcodes'
}
]

View File

@ -4,7 +4,7 @@ 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.65c02-opcodes' } # include 6502 and 65c02 opcodes
{ include: 'source.6502x-opcodes' }
{ include: '#comments' }
{ include: '#symbols' }
@ -35,7 +35,7 @@ repository:
endCaptures:
0:
name: 'punctuation.definition.string.end.65c02-generic'
name: 'string.quoted.double.assembly.65c02-generic'
name: 'string.quoted.double.65c02-generic'
}
# absolut address/number
{
@ -44,12 +44,12 @@ repository:
}
# hex, prefixed with ampersand($)
{
match: '-?\\$[A-Fa-f0-9]+'
match: '-?\\$\\b[A-Fa-f0-9]+\\b'
name: 'constant.numeric.hex.65c02-generic'
}
# hex, suffixed with h(h)
{
match: '-?([0-9]+)h'
match: '-?([a-fA-F0-9]+)h'
name: 'constant.numeric.hex.65c02-generic'
}
# binary

View File

@ -11,10 +11,10 @@ patterns: [
{ include: 'source.6502-opcodes' }
{ include: 'source.6502x-opcodes' }
{ include: '#comments' }
# symbols, constants, numbers
{ include: '#symbols' }
# directives
{ include: '#directives' }
# symbols, constants, numbers
{ include: '#symbols' }
]
# Repository starts here ------------------------------------------------------
@ -33,71 +33,98 @@ repository:
# symbols
symbols:
patterns: [
# Labels (at beginning of a line)
{
match: '^[A-Za-z\\._][A-Za-z0-9_:]*'
name: 'entity.name.function.acme'
}
# this section hilights labels as variables: results in pretty colorful listings, maybe you like it
# Labels inline
# {
# match: '\\b[A-Za-z][A-Za-z0-9_:]*\\b'
# name: 'variable.language'
# }
# Register A (like in ASL A)
{
match: '\\b[aA]\\b'
name: 'variable.language.register.acme'
}
# Registers X and Y (like in LDA $1000,X or LDA ($30),Y )
{
match: '(?<=,)([xXyY])\\b'
name: 'variable.language.register.acme'
}
# strings
{
begin: '"'
beginCaptures:
0:
name: 'punctuation.definition.string.begin.acme'
end: '"'
endCaptures:
0:
name: 'punctuation.definition.string.end.acme'
name: 'string.quoted.double.assembly.acme'
name: 'string.quoted.double.acme'
}
# absolut addressing/numbering
{
match: '\\#(\'.\'|[^\\s\']+)'
begin: '\''
end: '\''
name: 'string.quoted.single.assembly.acme'
}
# absolut addressing/numbering (including lo/hibyte by < or >)
{
match: '\\#(\\>?\\<?\\(?\\$?\\w*\\)?|[^\\s]\\h?*)'
name: 'constant.numeric.hex.acme'
}
# hex, prefixed with dollar ($)
# hex, prefixed with dollar ($) or 0x
{
match: '-?\\$[A-Fa-f0-9]+'
match: '\\$\\h+|0x\\h+'
name: 'constant.numeric.hex.acme'
}
# binary prefixed with %
{
match: '%[01]+'
match: '%[01]+|%[\\#\\.]+|0b[01]+|0b[\\#\\.]+'
name: 'constant.numeric.binary.acme'
}
# decimal
# Float
{
match: '\\b([0-9]+)\\b'
match: '\\d*\\.\\d+\\b'
name: 'constant.numeric.float.acme'
}
# Decimal (but not float)
{
match: '\\b\\d+\\b'
name: 'constant.numeric.decimal.acme'
}
# Cctal
{
match: '&([0-7]+)\\b'
name: 'constant.numeric.octal.acme'
}
]
# assembler directives
directives:
patterns: [
# File and Symbol control
# File and Symbol Control (pseudos)
{
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'
match: '\\!(?i:source|src|pseudopc|zn|zone|to|bin(ary)?|symbollist|sl|initmem)\\b'
name: 'support.function.pseudo.acme'
}
# Parsing control
# Parsing Control (more pseudos)
{
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'
match: '\\!(?i:macro|cpu|al|as|rl|rs|8|by|byte|le16|be16|16|wo|word|le24|be24|24|le32|be32|32|hex|h|fill|fi|align|skip|ct|convtab|tx|text|pet|scr|scrxor|raw|address|addr)\\b'
name: 'support.function.pseudo.acme'
}
# Macro control
# Conditional Control
{
match: '(?i:!\\bmacro|\\+[a-zA-Z0-9])\\b'
name: 'support.function.pseudo.acme'
}
# Conditional control
{
match: '!\\b(?i:if|if(n)?def|for|do|while|until)\\b'
match: '\\!(?i:if|if(n)?def|for|do|set|warn|error|serious|eof|endoffile)\\b'
name: 'keyword.control.conditional.acme'
}
# Conditional control II
{
match: '\\b(?i:else|while|until)\\b'
match: '(?i:while|until|else)\\b'
name: 'keyword.control.conditional.acme'
}
# Operators
{
match: '!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:|\\|\\|'
match: '\\!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:'
name: 'keyword.operator.acme'
}
# Operators II

198
grammars/asar.cson Normal file
View File

@ -0,0 +1,198 @@
# Adds Syntax highlighting for the Asar SNES Assembler
scopeName: 'source.assembly.65816.asar'
fileTypes: [
'asm'
]
name: 'Asar SNES Assembler'
patterns: [
{ include: 'source.65816-opcodes' }
{ include: 'source.65816l-opcodes' }
{ include: 'source.65816alt-opcodes' }
{ include: 'source.spc700-opcodes' }
{ include: 'source.superfx-opcodes' }
{ include: '#comments' }
{ include: '#symbols' }
{ include: '#directives' }
]
# Repository starts here ------------------------------------------------------
repository:
# comments
comments:
patterns: [
# semicolon line comment
{
match: ';.*$'
name: 'comment.line.semicolon.asar'
}
]
# symbols
symbols:
patterns: [
# delimited strings
{
begin: '"'
beginCaptures:
0: name: 'punctuation.definition.string.begin.asar'
end: '"'
endCaptures:
0: name: 'punctuation.definition.string.end.asar'
name: 'string.quoted.double.assembly.asar'
}
# labels
{
captures:
1: name: 'entity.name.function.label.asar'
2: name: 'entity.name.function.label.asar'
match: '(\\.*)\\b([A-Za-z0-9_]+):'
name: 'meta.label.asar'
}
# defines
{
captures:
1: name: 'keyword.operator.asar'
2: name: 'entity.name.function.label.asar'
match: '(!)\\b([A-Za-z0-9_]+)\\b'
name: 'meta.define.asar'
}
# absolut address/number
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.asar'
}
# hex, prefixed with ampersand($)
{
match: '-?\\$[A-Fa-f0-9]+'
name: 'constant.numeric.hex.asar'
}
# binary
{
match: '-?%[01]+'
name: 'constant.numeric.binary.asar'
}
# decimal
{
match: '-?\\b([0-9]+)\\b'
name: 'constant.numeric.decimal.asar'
}
]
# assembler directives
directives:
patterns: [
# arch command
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'constant.language.asar'
match: '\\b(arch)\\s+(65816|spc700(-inline)?|superfx)'
name: 'meta.arch.directive.asar'
}
# warn xkas command
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'support.function.pseudo.asar'
3: name: 'constant.language.asar'
match: '\\b(warn)\\s+(xkas)\\s+(on|off)\\b'
name: 'meta.warn.directive.asar'
}
# math command
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'support.function.pseudo.asar'
3: name: 'constant.language.asar'
match: '\\b(math)\\s+(pri|round)\\s+(on|off)\\b'
name: 'meta.math.directive.asar'
}
# namespace command
{
begin: '\\b(namespace)\\b'
captures:
1:
name: 'support.function.pseudo.asar'
end: '$'
name: 'meta.namespace.directive.asar'
patterns: [
# nested
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'constant.language.asar'
match: '\\b(nested)\\s+(on|off)\\b'
name: 'meta.namespace.nested.asar'
}
# off
{
match: '\\b(off)\\b'
name: 'constant.language.asar'
}
# identifier
{
match: '\\b[a-zA-Z0-9_]+\\b'
name: 'entity.name.function.label.asar'
}
]
}
# base command
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'constant.language.asar'
match: '\\b(base)\\s+(off)*'
name: 'meta.base.directive.asar'
}
# bank command
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'constant.language.asar'
match: '\\b(bank)\\s+(noassume|auto)*'
name: 'meta.bank.directive.asar'
}
# struct command
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'entity.name.function.label.asar'
3: name: 'constant.numeric.hex.asar'
match: '\\b(struct)\\s+([a-zA-Z0-9_]+)\\s+(\\S+)\\b'
name: 'meta.struct.directive.asar'
}
# endstruct command
{
captures:
1: name: 'support.function.pseudo.asar'
2: name: 'support.function.pseudo.asar'
3: name: 'constant.numeric.decimal.asar'
match: '\\b(endstruct)\\s+(align)*\\s+(\\S+)*'
name: 'meta.struct.directive.asar'
}
# data control
{
match: '\\b(inc(bin|src)|(push|pull)(pc|base)|warnpc|skip|asar|org|rep|d[bdlw]|(ex)?(lo|hi)rom|(full)?sa1rom|(no|sfx)rom|function)\\b'
name: 'support.function.pseudo.asar'
}
# conditional control
{
match: '\\b((end)?if)\\b'
name: 'keyword.control.conditional.asar'
}
# macro control
# TODO: fix identifier
{
match: '\\b((end)?macro)\\b'
# name: 'support.function.pseudo.asar'
name: 'keyword.directive.macro.asar'
}
# operators
{
match: '[-+/*^><|#\\[\\]()=.!&]'
name: 'keyword.operator.asar'
}
# TODO: Add built-in functions
]

106
grammars/asm6.cson Normal file
View File

@ -0,0 +1,106 @@
# Syntax Highlighting for the asm6 assembler
scopeName: 'source.asm6'
name: 'ASM6f (6502)' # Name shown in Atom Editor grammar selection
# File extensions associated with this grammar
fileTypes: [
's'
'asm'
]
patterns: [
{ include: 'source.65c02-opcodes' } # extend with 6502X opcodes
{ include: 'source.6502x-opcodes' } # extend with 6502X opcodes
{ include: '#comments' } # comments
{ include: '#symbols' } # symbols, constants, numbers
{ include: '#directives' } # cc65 assembler directives
]
# Repository starts here ------------------------------------------------------
repository:
# comments
comments:
patterns: [
# semicolon comments
{
match: ';.*$'
name: 'comment.line.semicolon.cc65-directives'
}
]
# symbols
symbols:
patterns: [
# strings
{
begin: '[\"\']'
beginCaptures:
0:
name: 'punctuation.definition.string.begin.cc65-directives'
end: '[\"\']'
endCaptures:
0:
name: 'punctuation.definition.string.end.cc65-directives'
name: 'string.quoted.double.cc65-directives'
}
# absolut addressing/numbers
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.cc65-directives'
}
# hex, prefixed with dollar sign($)
{
match: '-?\\$\\b[a-fA-F0-9]+\\b'
name: 'constant.numeric.hex.cc65-directives'
}
# hex, suffixed with h(h)
{
match: '-?\\b([a-fA-F0-9]+)h\\b'
name: 'constant.numeric.hex.cc65-directives'
}
# binary prefixed with %
{
match: '%[01]+'
name: 'constant.numeric.binary.cc65-directives'
}
# binary suffixed with b
{
match: '[01]+[bB]'
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:equ|include|incsrc|(inc)?bin|db|dw|byte|word|dcb|dcw|(dc\\.b)|(dc\\.w)|ignorenl|endinl|unstable|hunstable|inesprog|ineschr|inesmap|inesmir|nes2chrram|nes2prgram|nes2usb|nes2tv|nes2vs|nes2bram|nes2chrbram)\\b'
name: 'support.function.pseudo.cc65-directives'
}
# ca65 pseudo functions
{
match: '(\\.)?\\b(?i:dl|dh|hex|(ds\\.?b)|(ds\\.?w)|pad|org|align|fillvalue|base|if|elseif|else|endif|ifdef|ifndef|macro|endm|rept|endr|enum|ende|error)\\b'
name: 'support.function.pseudo.cc65-directives'
}
# address sizes, macpack packages
# {
# match: '\\b(?i:direct|zeropage|zp|absolute|abs|near|far|long|dword|atari|cbm|cpu|generic|longbranch)\\b'
# name: 'constant.language.cc65-directives'
# }
# Operators
{
match: '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|\\%'
name: 'keyword.operator.cc65-directives'
}
# Operators II/undocumented opcodes
{
match: '(\\.)\\b(?i:slo|rla|sre|rra|sax|lax|dcp|isc|anc|alr|arr|axs|las|ahx|shy|shx|tas|xaa)\\b'
name: 'keyword.operator.cc65-directives'
}
]

View File

@ -24,6 +24,7 @@ repository:
# symbols
symbols:
patterns: [
# strings
{
begin: '"'
beginCaptures:
@ -33,21 +34,21 @@ repository:
endCaptures:
0:
name: 'punctuation.definition.string.end.cc65-directives'
name: 'string.quoted.double.assembly.cc65-directives'
name: 'string.quoted.double.cc65-directives'
}
# absolut address/number
# absolut addressing/numbers
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.cc65-directives'
}
# hex, prefixed with ampersand($)
# hex, prefixed with dollar sign($)
{
match: '-?\\$[A-Fa-f0-9]+'
match: '-?\\$\\b[a-fA-F0-9]+\\b'
name: 'constant.numeric.hex.cc65-directives'
}
# hex, suffixed with h(h)
{
match: '-?([0-9]+)h'
match: '-?\\b([a-fA-F0-9]+)h\\b'
name: 'constant.numeric.hex.cc65-directives'
}
# binary
@ -67,43 +68,48 @@ repository:
patterns: [
# ca65 pseudo variables
{
match: '(\\.)?\\b(?i:\\*|asize|cpu|isize|paramcount|time|version)\\b'
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'
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'
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: 'support.function.pseudo.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'
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: 'support.function.pseudo.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'
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: 'support.function.pseudo.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'
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: 'support.function.pseudo.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'
match: '(\\.)\\b(?i:scope|segment|set(cpu)?|smart|struct|tag|undef(ine)?|union|warning|word|zeropage)\\b'
name: 'support.function.pseudo.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'
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__|VER_MAJOR|VER_MINOR)\\b'
name: 'constant.language.cc65-directives'
}
# address sizes, macpack packages
{
match: '\\b(?i:direct|zeropage|zp|absolute|abs|near|far|long|dword|atari|cbm|cpu|generic|longbranch)\\b'
name: 'constant.language.cc65-directives'
}
# Operators
{

View File

@ -0,0 +1,101 @@
# Syntax Highlighting for linker config files used with ld65 of the cc65 toolchain
scopeName: 'source.assembly.cc65-linker-config'
name: 'Linker Config File (cc65)' # Name shown in Atom Editor grammar selection
# File extensions associated with this grammar
fileTypes: [
'cfg'
'txt'
]
# include all directives and commands the toolchain supports
patterns: [
{ include: '#comments' }
{ include: '#symbols' }
]
# Repository starts here ------------------------------------------------------
repository:
# comments
comments:
patterns: [
# hash comments
{
match: '\\#.*$'
name: 'comment.line.cc65-linker-config'
}
]
# symbols
symbols:
patterns: [
# strings
{
begin: '"'
beginCaptures:
0:
name: 'punctuation.definition.string.begin.cc65-linker-config'
end: '"'
endCaptures:
0:
name: 'punctuation.definition.string.end.cc65-linker-config'
name: 'string.quoted.double.cc65-linker-config'
}
# hex, prefixed with dollar sign($)
{
match: '\\$\\b[a-fA-F0-9]+\\b'
name: 'constant.numeric.hex.cc65-linker-config'
}
# hex, suffixed with h(h)
{
match: '\\b([a-fA-F0-9]+)h\\b'
name: 'constant.numeric.hex.cc65-linker-config'
}
# binary
{
match: '%[01]+'
name: 'constant.numeric.binary.cc65-linker-config'
}
# decimal
{
match: '\\b([0-9]+)\\b'
name: 'constant.numeric.decimal.cc65-linker-config'
}
# areas
{
match: '\\b(?i:memory|segments|files|formats|features|symbols|once|lowcode|startup|zpsave)\\b'
name: 'storage.modifier.cc65-linker-config'
}
# labels
{
captures:
1: name: 'entity.name.function.label.cc65-linker-config'
match: '\\b([A-Za-z0-9_]+):'
name: 'meta.function.label.cc65-linker-config'
}
# attributes
{
match: '\\b(?i:load|type|define|start|size|fill|file|run|format|os|version|import|export|label|count|segment|order|default|addrsize|align)\\b'
name: 'storage.modifier.cc65-linker-config'
}
# linker constants
{
match: '\\b(__NAME_LOAD__|__NAME_RUN__|__NAME_SIZE__|__DATA_LOAD__|__DATA_RUN__|__DATA_SIZE__|__STACK_START__|__STACK_SIZE__|__STACK_LAST__|__STACK_FILEOFFS__)\\b'
name: 'constant.language.cc65-linker-config'
}
# address sizes, functions
{
match: '\\b(?i:direct|zeropage|zp|absolut|abs|near|far|long|dword|atari|cbm|cpu|generic|longbranch|yes|ro|rw|bss|weak)\\b'
name: 'constant.other.cc65-linker-config'
}
# case sensitive symbols
{
match: '(%\\bO|\\bo65)\\b'
name: 'constant.other.cc65-linker-config'
}
# operators
{
match: '='
name: 'keyword.operator.cc65-linker-config'
}
]

View File

@ -1,4 +1,4 @@
# Syntax Highlighting for the cc65 toolchain ans 6502 support
# Syntax Highlighting for the cc65 toolchain and 6502 support
scopeName: 'source.assembly.6502.cc65-toolchain'
name: '6502 Assembly (cc65)' # Name shown in Atom Editor grammar selection

171
grammars/kickass.cson Normal file
View File

@ -0,0 +1,171 @@
scopeName: 'source.assembly.6502.kickass'
name: 'Kick Assembler'
fileTypes: [
'a'
'asm'
's'
'S'
]
patterns: [
{ include: 'source.65c02-opcodes' }
{ include: 'source.6502x-opcodes' }
{ include: '#comments' }
{ include: '#directives' }
{ include: '#symbols' }
]
repository:
comments:
patterns: [
{
match: '(\\/\\/[^\\n]+)'
name: 'comment.line'
}
{
begin: '\\/\\*'
end: '\\*\\/'
name: 'comment.block'
}
]
symbols:
patterns: [
# ===============================================================
# Assembler symbols
{ # Labels
match: '^\\s*[a-zA-Z_][a-zA-Z0-9_]*:'
name: 'entity.name.function.kickass'
}
{ # Local labels
match: '!(:|[\\+\\-]+)'
name: 'entity.name.function.kickass'
}
{ # Variable functions, like var.getValue()
match: '(\\w+(?=\\())'
name: 'entity.name.function.kickass'
}
# ===============================================================
# Data types
{ # Chars
match: "\\'\\S\\'"
name: 'string.char.kickass'
}
{ # Strings
begin: '"'
end: '"'
name: 'string.quoted.kickass'
}
{ # Hex numbers
match: '-?\\$[A-Fa-f0-9]+'
name: 'constant.numeric.hex.kickass'
}
{ # Octals
match: '@([0-7]+)\\b'
name: 'constant.numeric.octal.kickass'
}
{ # Binary numbers
match: '%[01]+'
name: 'constant.numeric.binary.kickass'
}
{ # Decimal numbers
match: '\\b([0-9]+)\\b'
name: 'constant.numeric.decimal.kickass'
}
{ # Immediate values
match: '\\#([^\\s]+)'
name: 'constant.numeric.hex.kickass'
}
{ # Constants
match: '\\b([_A-Z][_A-Z0-9]+)\\b'
name: 'variable.kickass'
}
]
directives:
patterns: [
# ===============================================================
# Preprocessor directives
{
match: '(\\#)((?:define|undef))([\\s\\w]+)'
captures:
1: name: 'keyword.control.directive.kickass'
2: name: 'keyword.control.directive.kickass'
3: name: 'variable.kickass'
}
{
match: '(\\#)((?:endif|el(se|if)|if|importif))([\\s\\w]+)'
captures:
1: name: 'keyword.control.directive.kickass'
2: name: 'keyword.control.directive.kickass'
4: name: 'variable.kickass'
}
{
match: '(\\#)((import(once)?))([\\s\\w]+)'
name: 'keyword.control.directive.kickass'
}
# ===============================================================
# Assembler directive conditionals
{
match: '(\\.)((?:elif|if))'
captures:
1: name: 'keyword.control.directive.kickass'
2: name: 'keyword.control.directive.kickass'
}
{
match: '(\\}?(\\s+)?)(else)'
captures:
3: name: 'keyword.control.directive.kickass'
}
# ===============================================================
# Assembler directives misc
{ # Assembler directives that have inconsistant syntax
match: '(\\.)((?:return|namespace|print(now)?|by(te)?|align|assert(error)?|break|disk|dw(ord)?|encoding|enum|error(if)?|file(modify|namespace)?|fill(word)?|for|lohifill|memblock|modify|pc|plugin|pseudopc|segment(def|out)?|struct|te(xt)?|while|wo(rd)?|zp|import( binary| c64| source| text|once)))\\b'
name: 'keyword.control.directive.kickass'
}
{
match: '(\\}?(\\s+)?)(else)'
captures:
2: name: 'keyword.control.directive.kickass'
}
# ===============================================================
# Variables and Macros
{
match: '(\\.)(var|eval|const|label)(\\s*[a-zA-Z0-9_]*)(\\s*=)?'
captures:
1: name: 'keyword.control.directive.kickass'
2: name: 'keyword.control.directive.kickass'
3: name: 'support.function.kickass'
4: name: 'keyword.operator.kickass'
}
{
match: '(?:\\()(var|eval|const|label)(?=\\s*[a-zA-Z0-9_]*)'
captures:
1: name: 'keyword.control.directive.kickass'
2: name: 'support.function.kickass'
}
{
match: '(\\.)(function|macro)([\\s\\w_.]*)(\\()([^)]*)(\\))'
captures:
1: name: 'keyword.control.directive.kickass'
2: name: 'keyword.control.directive.kickass'
3: name: 'entity.name.function.kickass'
4: name: 'keyword.operator.kickass'
5: name: 'constant.variable.kickass'
6: name: 'keyword.operator.kickass'
}
{
match: '(\\.)(pseudocommand)(\\s+)([^\\s\\n]+)'
captures:
1: name: 'keyword.control.directive.kickass'
2: name: 'keyword.control.directive.kickass'
4: name: 'entity.name.function.kickass'
}
]

View File

@ -1,228 +1,217 @@
'fileTypes': []
'name': 'Merlin'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#M65816'
}
{
'include': '#M65816L'
}
{
'include': '#hex_number'
}
{
'include': '#decimal_number'
}
{
'match': '%[01][01_]*'
'name': 'constant.numeric.binary'
}
{
'match': '\\b(?i:TAS|TSA|SWA|TAD|TDA|BLT|BGE)\\b'
'name': 'keyword.mnemonic.65816.alt'
}
{
'match': '(?<=,)([xXyYsS])\\b'
'name': 'variable.language.register'
}
{
'begin': '"'
'end': '"'
'name': 'string.quoted.double'
}
{
'begin': '\''
'end': '\''
'name': 'string.quoted.single'
}
{
'match': '^[*].*'
'name': 'comment.line'
}
{
'match': ';.*'
'name': 'comment.line'
}
{
'match': '^][0-~]*\\b'
'name': 'entity.name.label.variable'
}
{
'match': '^:[0-~]*\\b'
'name': 'entity.name.label.local'
}
{
'match': '^[:-~][0-~]*\\b'
'name': 'entity.name.function'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'string.quoted.other.path'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)DSK|PUT|USE|SAV)\\s+(\\S*)'
'name': 'meta.path.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)CYC)\\s+((?i)ON|OFF|AVE)\\b'
'name': 'meta.cyc.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)EXP)\\s+((?i)ON|OFF|ONLY)\\b'
'name': 'meta.exp.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)LST)\\s+((?i)ON|OFF|RTN)\\b'
'name': 'meta.lst.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)LST)\\s+((?i)OFF)\\b'
'name': 'meta.lstdo.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)TR)\\s+((?i)ON|OFF|ADR)\\b'
'name': 'meta.tr.directive'
}
{
'captures':
'1':
'name': 'keyword.directive.string'
'2':
'name': 'string.delimited.begin'
'3':
'name': 'string.delimited'
'4':
'name': 'string.delimited.end'
'5':
'name': 'keyword.operator'
'6':
'name': 'constant.numeric.hexadecimal'
'comment': 'optional trailing hex data'
'match': '\\b((?i)ASC|DCI|INV|FLS|STR)\\s+(\\S)(.*?)(\\2|$)(,([0-9A-Fa-f]+))?'
'name': 'meta.string.delimited'
}
{
'captures':
'1':
'name': 'keyword.directive.string'
'2':
'name': 'string.delimited.begin'
'3':
'name': 'string.delimited'
'4':
'name': 'string.delimited.end'
'match': '\\b((?i)REV)\\s+(\\S)(.*?)(\\2|$)'
'name': 'meta.string.delimited.rev'
}
{
'begin': '\\b((?i)HEX)\\b'
'captures':
'1':
'name': 'keyword.directive.data'
'comment': 'HEX has a list of hex bytes w/o the $'
'end': '$'
'name': 'meta.hex'
'patterns': [
scopeName: 'source.assembly.65816.merlin'
fileTypes: []
name: 'Merlin'
patterns: [
{ include: 'source.65c02-opcodes' }
{ include: 'source.65816-opcodes' }
{ include: 'source.65816l-opcodes' }
{ include: 'source.65816alt-opcodes' }
{ include: '#comments' }
{ include: '#symbols' }
{ include: '#directives' }
# registers
# TODO: fix registers
# {
# 'match': '(?<=,)([xXyYsS])\\b'
# 'name': 'variable.language.register'
# }
]
repository:
# comments
comments:
patterns: [
# asterisk line comment
{
'match': '\\b[0-9A-Fa-f]{1,2}\\b'
'name': 'constant.numeric.hex'
match: '^[*].*'
name: 'comment.line.asterisk.merlin'
}
# semicolon line comment
{
'match': ';.*$'
'name': 'comment.line'
}
{
'match': ','
'name': 'keyword.operator'
}
{
'match': '\\S'
'name': 'invalid.illegal'
match: ';.*$'
name: 'comment.line.semicolon.merlin'
}
]
# symbols
symbols:
patterns: [
# delimited strings
{
begin: '[\'"]'
beginCaptures:
0: name: 'punctuation.definition.string.begin.merlin'
end: '[\'"]'
endCaptures:
0: name: 'punctuation.definition.string.end.merlin'
name: 'string.quoted.double.assembly.merlin'
}
# TODO: highlight strings with all valid delimiters
# {
# captures:
# 1: name: 'string.delimited.begin.merlin'
# 2: name: 'string.delimited.merlin'
# 3: name: 'string.delimited.end.merlin'
# match: '\\b(\\S)(.*?)(\\1)\\b'
# }
# TODO: fix label scopes
# Variables
{
match: '^][:-~][0-~]+'
# name: 'variable.named.merlin'
name: 'entity.name.function.label.merlin'
}
# Local labels
{
match: '^:[:-~][0-~]+'
name: 'entity.name.function.label.merlin'
}
# Global labels
{
match: '^[:-~][0-~]+'
name: 'entity.name.function.merlin'
}
# absolut address/number
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.merlin'
}
# hex, prefixed with ampersand($)
{
match: '-?\\$[A-Fa-f0-9]+'
name: 'constant.numeric.hex.merlin'
}
# octal, prefixed with @
{
match: '@([0-7]+)\\b'
name: 'constant.numeric.octal.merlin'
}
# binary
{
match: '%[01]+'
name: 'constant.numeric.binary.merlin'
}
# decimal
{
match: '\\b([0-9]+)\\b'
name: 'constant.numeric.decimal.merlin'
}
]
# assembler directives
directives:
patterns: [
# file control
{
match: '\\b(?i:equ|ext|ent|org|rel|obj|var|typ|end|dum|dend|ast|dat|lstdo|pag|ttl|skp|chk|err|kbd|lup|--\\^|mx|pau|sw|usr|xc)\\b'
name: 'keyword.directive.merlin'
}
# data control
{
match: '\\b(?i:da|dw|ddb|db|dfb|adr|adrl|ds)\\b'
name: 'support.function.pseudo.merlin'
}
# conditional control
{
match: '\\b(?i:do|else|if|fin)\\b'
name: 'keyword.control.conditional.merlin'
}
# macro control
{
match: '\\b(?i:mac)\\b|<<<'
name: 'support.function.pseudo.merlin'
# name: 'keyword.directive.macro.merlin'
}
# operators
{
match: '[-+/*^><|#\\[\\](),=.!&]'
name: 'keyword.operator.merlin'
}
# disk commands
{
captures:
1: name: 'support.function.pseudo.merlin'
2: name: 'string.quoted.other.path.merlin'
match: '\\b((?i:dsk|put|use|sav))\\s+(\\S*)'
name: 'meta.disk.directive.merlin'
}
# cycle count
{
captures:
1: name: 'support.function.pseudo.merlin'
2: name: 'constant.language.merlin'
match: '\\b((?i:cyc))\\s+((?i:on|off|ave))\\b'
name: 'meta.cyc.directive.merlin'
}
# expand control
{
captures:
1: name: 'support.function.pseudo.merlin'
2: name: 'constant.language.merlin'
match: '\\b((?i:exp))\\s+((?i:on|off|only))\\b'
name: 'meta.exp.directive.merlin'
}
# list control
{
captures:
1: name: 'support.function.pseudo.merlin'
2: name: 'constant.language.merlin'
match: '\\b((?i:lst))\\s+((?i:off))\\b'
name: 'meta.exp.directive.merlin'
}
# truncation control
{
captures:
1: name: 'support.function.pseudo.merlin'
2: name: 'constant.language.merlin'
match: '\\b((?i:tr))\\s+((?i:on|off|adr))\\b'
name: 'meta.tr.directive.merlin'
}
# string command
{
captures:
1: name: 'support.function.pseudo.merlin'
2: name: 'string.delimited.begin.merlin'
3: name: 'string.delimited.merlin'
4: name: 'string.delimited.end.merlin'
5: name: 'constant.numeric.hex.merlin'
match: '\\b((?i:asc|dci|inv|fls|str))\\s+(\\S)(.*?)(\\2|\\S),([a-fA-F0-9]+)?'
}
# reverse command
{
captures:
1: name: 'support.function.pseudo.merlin'
2: name: 'string.delimited.begin.merlin'
3: name: 'string.delimited.merlin'
4: name: 'string.delimited.end.merlin'
match: '\\b((?i:rev))\\s+(\\S)(.*?)(\\2|$)'
}
# hex command
{
begin: '\\b((?i:hex))\\b'
captures:
1:
name: 'support.function.pseudo.merlin'
end: '$'
name: 'meta.hex.directive.merlin'
patterns: [
# hex without $
{
match: '\\b[a-fA-F0-9]{1,2}\\b'
name: 'constant.numeric.hex.merlin'
}
# semicolon comments
{
match: ';.*'
name: 'comment.line.semicolon.merlin'
}
# number check
{
match: '(?!,)\\S'
name: 'invalid.illegal.merlin'
}
]
}
]
}
{
'match': '\\b(?i:DSK|EQU|EXT|ENT|ORG|REL|OBJ|PUT|USE|VAR|SAV|TYP|END|DUM|DEND|AST|CYC|DAT|EXP|LST|LSTDO|PAG|TTL|SKP|TR|CHK|ERR|KBD|LUP|--\\^|MX|PAU|SW|USR|XC)\\b'
'name': 'keyword.directive'
}
{
'match': '\\b(?i:DA|DW|DDB|DB|DFB|ADR|ADRL|HEX|DS|ASC|DCI|INV|FLS|REV|STR)\\b'
'name': 'keyword.directive.data'
}
{
'match': '\\b(?i:DO|ELSE|IF|FIN)\\b'
'name': 'keyword.control.conditional'
}
{
'match': '\\b(?i:MAC)\\b|<<<'
'name': 'keyword.directive.macro'
}
{
'match': '[-+/*^><|#\\[\\](),=.!&]'
'name': 'keyword.operator'
}
]
'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.merlin'

View File

@ -0,0 +1,29 @@
# Opcodes for the Sony SPC-700 audio processing unit used in the SNES
scopeName: 'source.spc700-opcodes'
patterns: [
# The SPC700 instruction set aliases
{
include: '#mnemonics-spc700'
}
]
# Respository starts here -----------------------------------------------------
repository:
# SPC700 instruction set
'mnemonics-spc700':
patterns: [
# mnemonics
{
match: '\\b(?i:ADC|ADDW|AND|AND1|ASL|BBC|BBS|BCC|BCS|BEQ|BMI|BNE|BPL|BVC|BVS|BRA|BRK|CALL|CBNE|CLR1|CLRC|CLRP|CLRV|CMP|CMPW|DAA|DAS|DBNZ|DEC|DECW|DI|DIV|EI|EOR|EOR1|INC|INCW|JMP|LSR|MOV|MOV1|MOVW|MUL|NOP|NOT1|NOTC|OR|OR1|PCALL|POP|PUSH|RET|RETI|ROL|ROR|SBC|SET1|SETC|SETP|SLEEP|STOP|SUBW|TCALL|TCLR1|TSET1|XCN)\\b'
name: 'keyword.mnemonic.spc700.spc700-opcodes'
}
# registers
{
match: '\\b(?i:F[0-9A-F]|SP|PC|PSW)\\b'
name: 'support.function.pseudo.spc700-opcodes'
# name: 'storage.other.register.spc700-opcodes'
}
]

View File

@ -0,0 +1,29 @@
# Opcodes for the SuperFX DSP used in some SNES cartridges
scopeName: 'source.superfx-opcodes'
patterns: [
# The SPC700 instruction set aliases
{
include: '#mnemonics-superfx'
}
]
# Respository starts here -----------------------------------------------------
repository:
# SuperFX instruction set
'mnemonics-superfx':
patterns: [
# mnemonics
{
match: '\\b(?i:ADD|ADC|ALT1|ALT2|ALT3|AND|ASR|BCC|BCS|BEQ|BGE|BIC|BLT|BMI|BNE|BPL|BRA|BVC|BVS|CACHE|CMODE|CMP|COLOR|DEC|DIV2|FMULT|FROM|GETB|GETBH|GETBL|GETBS|GETC|HIB|IBT|INC|IWT|JAL|JMP|LDB|LDW|LEA|LINK|LJMP|LM|LMS|LMULT|LOB|LOOP|LSR|MERGE|MOVE|MOVEB|MOVES|MOVEW|MULT|NOP|NOT|OR|PLOT|POP|PUSH|RAMB|RET|ROL|ROMB|ROR|RPIX|SBC|SBK|SEX|SM|SMS|STB|STOP|STW|SUB|SWAP|TO|UMULT|WITH|XOR)\\b'
name: 'keyword.mnemonic.superfx.superfx-opcodes'
}
# registers
{
match: '\\b(?i:R0|R1|R2|R3|R4|R5|R6|R7|R8|R9|R10|R11|R12|R13|R14|R15|SP|LR|PC|SFR|BRAMR|PBR|ROMBR|CFGR|SCBR|CLSR|SCMR|VCR|RAMBR|CBR)\\b'
name: 'support.function.pseudo.superfx-opcodes'
# name: 'storage.other.register.superfx-opcodes'
}
]

View File

@ -34,21 +34,21 @@ repository:
endCaptures:
0:
name: 'punctuation.definition.string.end.wdc-toolchain'
name: 'string.quoted.double.assembly.wdc-toolchain'
name: 'string.quoted.double.wdc-toolchain'
}
# absolut addressing/numbering
# absolut addressing/numbers
{
match: '\\#(\'.\'|[^\\s\']+)'
name: 'constant.numeric.hex.wdc-toolchain'
}
# hex, prefixed with ampersand($)
# hex, prefixed with dollar sign($)
{
match: '-?\\$[A-Fa-f0-9]+'
match: '-?\\$\\b[a-fA-F0-9]+\\b'
name: 'constant.numeric.hex.wdc-toolchain'
}
# hex, suffixed with h(h)
{
match: '-?([0-9]+)h'
match: '-?\\b([a-fA-F0-9]+)h'
name: 'constant.numeric.hex.wdc-toolchain'
}
# binary prefixed with %
@ -63,7 +63,7 @@ repository:
}
# octal and decimal
{
match: '\\b([0-9]+(d|o|q)?)\\b'
match: '\\b([0-9]+[doq]?)\\b'
name: 'constant.numeric.decimal.wdc-toolchain'
}
]
@ -73,7 +73,7 @@ repository:
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'
match: '\\b(?i:append|include|insert|end(s|mod)?|exit|module|section|ref_only|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
@ -108,7 +108,7 @@ repository:
}
# Operators II
{
match: '\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b'
match: '\\.\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b\\.'
name: 'keyword.operator.wdc-toolchain'
}
]

View File

@ -1,6 +1,6 @@
{
"name": "language-65asm",
"version": "8.0.0",
"version": "10.5.0",
"description": "Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with extra support for various compilers.",
"repository": "git@github.com:MatthewCallis/language-65asm.git",
"license": "MIT",