First version syntax definition

This commit is contained in:
John Mumm 2013-10-10 12:39:52 -04:00
parent cb65a38071
commit 4ddad0b27a
4 changed files with 213 additions and 0 deletions

83
6502asm.JSON-tmLanguage Normal file
View File

@ -0,0 +1,83 @@
{
"name": "6502 asm",
"scopeName": "source.asm",
"fileTypes": ["asm"],
"patterns": [
{
"match": "(?i)\\b(adc|and|asl|dec|dex|dey|eor|inc|inx|iny|lsr|ora|rol|ror|sbc)\\b",
"name": "keyword.operator.asm",
"comment": "Arithmetic and logic instruction mnemonics"
},
{
"match": "(?i)\\b(bcc|bcs|beq|bmi|bne|bpl|bvc|bvs|jmp|jsr|rti|rts)\\b",
"name": "keyword.operator.asm",
"comment": "Branch instruction mnemonics"
},
{
"match": "(?i)\\b(bit|cmp|cpx|cpy)\\b",
"name": "keyword.operator.asm",
"comment": "Comparison instructions"
},
{
"match": "(?i)\\b(clc|cld|cli|clv|sec|sed|sei)\\b",
"name": "keyword.operator.asm",
"comment": "Flag setting instructions"
},
{
"match": "(?i)\\b(lda|ldx|ldy|pha|php|pla|plp|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\\b",
"name": "keyword.operator.asm",
"comment": "Load, store, and transfer instructions"
},
{
"match": "(\/\/|;)(\\s|\\S)*",
"name": "comment.line.asm",
"comment": "Comment line"
},
{
"begin": "(\/\\*)",
"end": "(\\*\/)",
"name": "comment.block.asm",
"comment": "C-style comment block (AVR ASM 2.0 only)"
},
{
"match": "(^|\\s)\"[\\w\\s\\W]*\"($|\\s)",
"name": "string.asm",
"comment": "Single-line string"
},
{
"match": "(^|\\s)\\'[\\w\\s\\W]*\\'($|\\s)",
"name": "string.asm",
"comment": "Single-line string"
},
{
"match": "(?i)\\b($(\\d|[A-F])+)\\b",
"name": "constant.numeric.asm",
"comment": "Hex number constant"
},
{
"match": "\\%(0b(0|1)+)\\b",
"name": "constant.numeric.asm",
"comment": "Bin number constant"
},
{
"match": "\\#^$^%(0|[1-9]\\d+)\\b",
"name": "constant.numeric.asm",
"comment": "Dec number constant"
}
],
"uuid": "2d29de24-0f40-4855-a408-6fe8b3055153"
}

117
6502asm.tmLanguage Normal file
View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>asm</string>
</array>
<key>name</key>
<string>6502 asm</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>Arithmetic and logic instruction mnemonics</string>
<key>match</key>
<string>(?i)\b(adc|and|asl|dec|dex|dey|eor|inc|inx|iny|lsr|ora|rol|ror|sbc)\b</string>
<key>name</key>
<string>keyword.operator.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Branch instruction mnemonics</string>
<key>match</key>
<string>(?i)\b(bcc|bcs|beq|bmi|bne|bpl|bvc|bvs|jmp|jsr|rti|rts)\b</string>
<key>name</key>
<string>keyword.operator.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Comparison instructions</string>
<key>match</key>
<string>(?i)\b(bit|cmp|cpx|cpy)\b</string>
<key>name</key>
<string>keyword.operator.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Flag setting instructions</string>
<key>match</key>
<string>(?i)\b(clc|cld|cli|clv|sec|sed|sei)\b</string>
<key>name</key>
<string>keyword.operator.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Load, store, and transfer instructions</string>
<key>match</key>
<string>(?i)\b(lda|ldx|ldy|pha|php|pla|plp|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b</string>
<key>name</key>
<string>keyword.operator.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Comment line</string>
<key>match</key>
<string>(//|;)(\s|\S)*</string>
<key>name</key>
<string>comment.line.asm</string>
</dict>
<dict>
<key>begin</key>
<string>(/\*)</string>
<key>comment</key>
<string>C-style comment block (AVR ASM 2.0 only)</string>
<key>end</key>
<string>(\*/)</string>
<key>name</key>
<string>comment.block.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Single-line string</string>
<key>match</key>
<string>(^|\s)"[\w\s\W]*"($|\s)</string>
<key>name</key>
<string>string.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Single-line string</string>
<key>match</key>
<string>(^|\s)\'[\w\s\W]*\'($|\s)</string>
<key>name</key>
<string>string.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Hex number constant</string>
<key>match</key>
<string>(?i)\b($(\d|[A-F])+)\b</string>
<key>name</key>
<string>constant.numeric.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Bin number constant</string>
<key>match</key>
<string>\%(0b(0|1)+)\b</string>
<key>name</key>
<string>constant.numeric.asm</string>
</dict>
<dict>
<key>comment</key>
<string>Dec number constant</string>
<key>match</key>
<string>\#^$^%(0|[1-9]\d+)\b</string>
<key>name</key>
<string>constant.numeric.asm</string>
</dict>
</array>
<key>scopeName</key>
<string>source.asm</string>
<key>uuid</key>
<string>2d29de24-0f40-4855-a408-6fe8b3055153</string>
</dict>
</plist>

1
package-metadata.json Normal file
View File

@ -0,0 +1 @@
{"url": "https://github.com/jtfmumm/6502asm-sublime", "version": "0.1", "description": "6502 asm syntax definition for Sublime Text 2"}

12
package-metadata.plist Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>description</key>
<string>6502 asm syntax definition for Sublime Text 2</string>
<key>url</key>
<string>https://github.com/jtfmumm/6502asm-sublime</string>
<key>version</key>
<string>0.1</string>
</dict>
</plist>