Merlin support

This commit is contained in:
Kelvin Sherlock 2013-04-01 20:35:23 -04:00
parent 753bb81125
commit aa3f9b2594
3 changed files with 419 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Merlin Comments</string>
<key>scope</key>
<string>source.asm.65816.merlin</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>*</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_DISABLE_INDENT</string>
<key>value</key>
<string>yes</string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>A2F150FF-2999-441F-81E5-B65646A26E4F</string>
</dict>
</plist>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Merlin Folding</string>
<key>scope</key>
<string>source.asm.65816.merlin</string>
<key>settings</key>
<dict>
<key>foldingStartMarker</key>
<string>\b(?i:DUM|DO|IF|MAC|LUP)\b</string>
<key>foldingStopMarker</key>
<string>\b(?i:DEND|FIN)\b|&lt;&lt;&lt;|--\^</string>
</dict>
<key>uuid</key>
<string>9DDC3C1F-C4A9-4888-BFBA-1CFF7448AC47</string>
</dict>
</plist>

370
Syntaxes/Merlin.tmLanguage Normal file
View File

@ -0,0 +1,370 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>S</string>
</array>
<key>name</key>
<string>Merlin</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.asm.65816</string>
</dict>
<dict>
<key>include</key>
<string>source.asm.65816#long_mnemonics</string>
</dict>
<dict>
<key>include</key>
<string>source.asm.65816#hex_number</string>
</dict>
<dict>
<key>include</key>
<string>source.asm.65816#decimal_number</string>
</dict>
<dict>
<key>match</key>
<string>%[01][01_]*</string>
<key>name</key>
<string>constant.numeric.binary</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:TAS|TSA|SWA|TAD|TDA|BLT|BGE)\b</string>
<key>name</key>
<string>keyword.mnemonic.65816.alt</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;=,)([xXyYsS])\b</string>
<key>name</key>
<string>variable.language.register</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>end</key>
<string>"</string>
<key>name</key>
<string>string.quoted.double</string>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>end</key>
<string>'</string>
<key>name</key>
<string>string.quoted.single</string>
</dict>
<dict>
<key>match</key>
<string>^[*].*</string>
<key>name</key>
<string>comment.line</string>
</dict>
<dict>
<key>match</key>
<string>;.*</string>
<key>name</key>
<string>comment.line</string>
</dict>
<dict>
<key>match</key>
<string>^][0-~]*\b</string>
<key>name</key>
<string>entity.name.label.variable</string>
</dict>
<dict>
<key>match</key>
<string>^:[0-~]*\b</string>
<key>name</key>
<string>entity.name.label.local</string>
</dict>
<dict>
<key>match</key>
<string>^[:-~][0-~]*\b</string>
<key>name</key>
<string>entity.name.function</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.quoted.other.path</string>
</dict>
</dict>
<key>comment</key>
<string>eg: KEEP pathname</string>
<key>match</key>
<string>\b((?i)DSK|PUT|USE|SAV)\s+(\S*)</string>
<key>name</key>
<string>meta.path.directive</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.language</string>
</dict>
</dict>
<key>comment</key>
<string>eg: KEEP pathname</string>
<key>match</key>
<string>\b((?i)CYC)\s+((?i)ON|OFF|AVE)\b</string>
<key>name</key>
<string>meta.cyc.directive</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.language</string>
</dict>
</dict>
<key>comment</key>
<string>eg: KEEP pathname</string>
<key>match</key>
<string>\b((?i)EXP)\s+((?i)ON|OFF|ONLY)\b</string>
<key>name</key>
<string>meta.exp.directive</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.language</string>
</dict>
</dict>
<key>comment</key>
<string>eg: KEEP pathname</string>
<key>match</key>
<string>\b((?i)LST)\s+((?i)ON|OFF|RTN)\b</string>
<key>name</key>
<string>meta.lst.directive</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.language</string>
</dict>
</dict>
<key>comment</key>
<string>eg: KEEP pathname</string>
<key>match</key>
<string>\b((?i)LST)\s+((?i)OFF)\b</string>
<key>name</key>
<string>meta.lstdo.directive</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.language</string>
</dict>
</dict>
<key>comment</key>
<string>eg: KEEP pathname</string>
<key>match</key>
<string>\b((?i)TR)\s+((?i)ON|OFF|ADR)\b</string>
<key>name</key>
<string>meta.tr.directive</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive.string</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.delimited.begin</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>string.delimited</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>string.delimited.end</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.operator</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>constant.numeric.hexadecimal</string>
</dict>
</dict>
<key>comment</key>
<string>optional trailing hex data</string>
<key>match</key>
<string>\b((?i)ASC|DCI|INV|FLS|STR)\s+(\S)(.*?)(\2|$)(,([0-9A-Fa-f]+))?</string>
<key>name</key>
<string>meta.string.delimited</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive.string</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.delimited.begin</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>string.delimited</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>string.delimited.end</string>
</dict>
</dict>
<key>match</key>
<string>\b((?i)REV)\s+(\S)(.*?)(\2|$)</string>
<key>name</key>
<string>meta.string.delimited.rev</string>
</dict>
<dict>
<key>begin</key>
<string>\b((?i)HEX)\b</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive.data</string>
</dict>
</dict>
<key>comment</key>
<string>HEX has a list of hex bytes w/o the $</string>
<key>end</key>
<string>$</string>
<key>name</key>
<string>meta.hex</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\b[0-9A-Fa-f]{1,2}\b</string>
<key>name</key>
<string>constant.numeric.hex</string>
</dict>
<dict>
<key>match</key>
<string>;.*$</string>
<key>name</key>
<string>comment.line</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>keyword.operator</string>
</dict>
<dict>
<key>match</key>
<string>\S</string>
<key>name</key>
<string>invalid.illegal</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\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</string>
<key>name</key>
<string>keyword.directive</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:DA|DW|DDB|DB|DFB|ADR|ADRL|HEX|DS|ASC|DCI|INV|FLS|REV|STR)\b</string>
<key>name</key>
<string>keyword.directive.data</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:DO|ELSE|IF|FIN)\b</string>
<key>name</key>
<string>keyword.control.conditional</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:MAC)\b|&lt;&lt;&lt;</string>
<key>name</key>
<string>keyword.directive.macro</string>
</dict>
<dict>
<key>match</key>
<string>[-+/*^&gt;&lt;|#\[\](),=.!&amp;]</string>
<key>name</key>
<string>keyword.operator</string>
</dict>
</array>
<key>scopeName</key>
<string>source.asm.65816.merlin</string>
<key>uuid</key>
<string>F978EA07-532B-4F41-A8D8-808CD855B3F7</string>
</dict>
</plist>