Compare commits

...

21 Commits

Author SHA1 Message Date
Kelvin Sherlock
0466fe1791 update syntax 2023-07-22 16:19:10 -04:00
Kelvin Sherlock
e87d04edcc sn asm 2023-07-20 16:42:43 -04:00
Kelvin Sherlock
135b909b0d orca/m macgen: ! is a comment character 2023-05-15 19:35:27 -04:00
Kelvin Sherlock
5ceb1a3418 fix yaml 2022-09-13 16:54:11 -04:00
ksherlock
f85bd90adc
Merge pull request #1 from decrazyo/master
add ca65 predefined macro packages
2022-07-07 15:30:37 -04:00
decrazyo
4dda716df5 add ca65 predefined macro packages 2022-07-05 21:30:49 -05:00
Kelvin Sherlock
d2a2e53078 S-C Assembler 2021-07-29 17:59:57 -04:00
Kelvin Sherlock
f3fb502073 fix DCB 2021-07-29 17:59:31 -04:00
Kelvin Sherlock
a6f23cc030 local identifiers 2021-07-15 19:59:44 -04:00
Kelvin Sherlock
9c9afb75ef merlin linker - gequ 2021-04-09 00:23:49 -04:00
Kelvin Sherlock
c5f707686d add some missing m740 instructions 2021-01-29 23:48:43 -05:00
Kelvin Sherlock
6609004905 add micol macro assembler syntax. 2020-08-15 13:32:01 -04:00
Kelvin Sherlock
16a2e8f434 MPW Asm PRINT operand can take multiple parameters. 2020-07-14 22:27:34 -04:00
Kelvin Sherlock
3c99a37d4f Merlin FIXS command. needed since I encountered some expanded merlin source code too big to load in merlin.
also adds ; before comments.
2019-12-08 12:27:54 -05:00
Kelvin Sherlock
09b757b56d Merlin - add MAC and EOM mnemonics 2019-12-08 12:26:52 -05:00
Kelvin Sherlock
8310fda0ae add merlin 16+ link script syntax. 2019-12-04 20:30:46 -05:00
Kelvin Sherlock
6c27bd47f8 add missing MX pseudo op. 2019-12-04 20:28:31 -05:00
Kelvin Sherlock
ae713828a7 DL is an allowed synonym for ADRL. 2019-12-04 20:28:12 -05:00
Kelvin Sherlock
8e49e49694 strip . modifer from opcodes
opcode is not missing if we have the macro declaration
2019-08-25 17:21:29 -04:00
Kelvin Sherlock
27a5a9ac77 add missing DC and DS directives (MPW Asm IIgs) 2019-08-25 17:20:48 -04:00
Kelvin Sherlock
8389c42dd7 update macgen commands 2018-10-13 18:02:15 -04:00
14 changed files with 1489 additions and 216 deletions

View File

@ -2,6 +2,22 @@
{
"caption": "Merlin To Text",
"command": "merlin_to_text"
},
{
"caption": "Merlin MacGen",
"command": "merlin_mac_gen"
},
{
"caption": "Merlin Fix Space",
"command": "merlin_fixs"
},
{
"caption": "ORCA/M MacGen",
"command": "orca_mac_gen"
},
{
"caption": "MPW Asm IIgs MacGen",
"command": "mpw_mac_gen"
}
]

View File

@ -0,0 +1,5 @@
{
"merlin_macro_directories": ["/Library/GoldenGate/Libraries/Merlin"],
"orca_macro_directories": ["/Library/GoldenGate/Libraries/AInclude/", "/Library/GoldenGate/Libraries/ORCAInclude"],
"mpw_macro_directories": ["/Library/MPW/Interfaces/AIIGSIncludes/"]
}

View File

@ -34,7 +34,7 @@ contexts:
scope: keyword.mnemonic.65816.alt
mnemonics-65c02-m740:
- match: \b(?i:CLT|COM|LDM|RRF|SET|TST)\b
- match: \b(?i:CLT|COM|LDM|RRF|SET|TST|MUL|DIV|CLB|SEB|BBC|BBS)\b
scope: keyword.mnemonic.m740
mnemonics-sweet16:

View File

@ -70,7 +70,7 @@ contexts:
scope: support.function.macro.toolbox
- match: \b((?i)DC|DCB|DS)([.](.))?
- match: \b((?i)DCB|DC|DS)([.](.))?
scope: meta.dc.directive
captures:
1: keyword.directive.data
@ -219,12 +219,11 @@ contexts:
operand-print:
- include: macro-parm
- match: ','
- match: \b(?i:ON|OFF|PUSH|POP)\b
scope: constant.language
set: expect-comment
- match: \b(?i:NO)?(?i:GEN|PAGE|WARN|MCALL|OBJ|DATA|MDIR|HDR|LITS|STAT|SYM)\b
scope: constant.language
set: expect-comment
- include: expect-comment

View File

@ -0,0 +1,185 @@
%YAML 1.2
---
# AUX, ZIP, IMP, PFX, REZ - quick asm extensions.
name: Merlin Link Script
file_extensions:
- S
scope: source.linker.merlin
variables:
ws: '[ \t]+'
ident: '[:-~][0-~]*'
contexts:
prototype:
- include: comment
- include: eol
main:
- meta_include_prototype: false
- match: ^[;*]
push:
- meta_scope: comment.line
- match: \n
pop: true
- match: '^{{ident}}'
scope: entity.name.label
- match: '{{ws}}'
push: opcode
eol:
- match: '$'
pop: true
comment:
- match: (?<=[\t ]);
push:
- meta_scope: comment.line
- match: \n
pop: true
- include: eol
expect-comment:
- include: comment
- match: \S
scope: invalid.illegal.expect.comment
numbers:
- match: \b\d+\b
scope: constant.numeric
- match: \$[0-9a-fA-F]+\b
scope: constant.numeric.hex
- match: \%[01_]+\b
scope: constant.numeric.binary
strings:
# special case for ''' and """
- match: "(')'(')"
captures:
0: string.quoted.single
1: punctuation.definition.string.begin
2: punctuation.definition.string.end
- match: '(")"(")'
captures:
0: string.quoted.double
1: punctuation.definition.string.begin
2: punctuation.definition.string.end
- match: "'"
scope: punctuation.definition.string.begin
push:
- meta_include_prototype: false
- meta_scope: string.quoted.single
- match: "'"
scope: punctuation.definition.string.end
pop: true
- match: \n
scope: invalid.illegal.newline.asm
pop: true
- match: '"'
scope: punctuation.definition.string.begin
push:
- meta_include_prototype: false
- meta_scope: string.quoted.double
- match: '"'
scope: punctuation.definition.string.end
pop: true
- match: \n
scope: invalid.illegal.newline.asm
pop: true
opcode:
- match: '{{ws}}'
set: expect-comment
# numeric operand
- match: \b(?i:ORG|ADR|DS|KND|KIND?|LKV|VER|DO|EQU|GEQU?|ALI|RTY|RID|RAT|AUX)\b
scope: keyword.directive
set: operand-number
- match: '='
scope: keyword.directive
set: operand-number
- match: \b(?i:TYP)\b
scope: keyword.directive
set: operand-typ
# path operand
- match: \b(?i:PUT|ASM|LINK?|LNK|SAV|IF|LIB|RES|FIL|IMP|PFX|REZ)\b
scope: keyword.directive
set: operand-path
- match: \b(?i:CMD)\b
scope: keyword.directive
set: operand-free-text
- match: \b(?i:KBD)\b
scope: keyword.directive
set: operand-string
- match: \b(?i:OVR)\b
scope: keyword.directive
set: operand-ovr
# no operand
- match: \b(?i:END|DAT|ENT|EXT|NOL|FAS|ELS|FIN)\b
scope: keyword.directive
set: operand-none
- match: \b(?i:POS|LEN)\b
scope: keyword.directive
set: operand-label
operand-none:
- include: expect-comment
operand-label:
- match: '{{ident}}'
scope: entity.name.label
set: expect-comment
- include: expect-comment
operand-ovr:
# OVR ALL | OFF | <blank>
- match: \b(?i:ALL|OFF)\b
scope: constant.language
set: expect-comment
- include: expect-comment
operand-path:
- match: \S+
scope: string.unquoted
set: expect-comment
- include: expect-comment
operand-free-text:
- match: '.'
scope: string.unquoted
operand-typ:
# TYP <short name or number>
- include: numbers
- match: \b(?i:BAD|BIN|TXT|DIR|ADB|AWP|ASP|GSB|TDF|BDF|SRC|OBJ|LIB|S16|RTL|EXE|PIF|TIF|NDA|CDA|TOL|DRV|DOC|PNT|PIC|FON|PAS|CMD)\b
scope: constant.language
- include: expect-comment
operand-number:
- include: numbers
- match: '{{ident}}'
scope: entity.name.label
set: expect-comment
- include: expect-comment
operand-string:
- include: strings
- include: expect-comment

View File

@ -7,6 +7,7 @@ scope: source.asm.65816.merlin
variables:
ws: '[ \t]+'
ident: '[:-~][0-~]*'
lident: '[\]:][0-~]*'
contexts:
prototype:
@ -27,7 +28,7 @@ contexts:
- match: '^({{ident}}){{ws}}((?i)MAC)\b'
captures:
1: entity.name.macro
1: entity.name.function
2: keyword.directive
push: operand
@ -50,10 +51,12 @@ contexts:
2: keyword.directive
push: operand
- match: '^{{lident}}'
scope: entity.name.label.local
- match: '^{{ident}}'
scope: entity.name.label
scope: entity.name.function
opcode:
@ -73,7 +76,7 @@ contexts:
scope: support.function.smart-macro.toolbox
- match: \b(?i:DFB|DB|DDB|DA|DW|ADR|ADRL|DS)\b
- match: \b(?i:DFB|DB|DDB|DA|DW|ADR|ADRL|DL|DS)\b
scope: keyword.directive.data
- match: \b(?i:HEX)\b
@ -89,7 +92,7 @@ contexts:
- match: =|<<<|--\^|>>>
scope: keyword.directive
- match: \b(?i:PMC|ORG|REL|TYP|DUM|DEND|END|CHK|DAT|ERR|EXT|EXD|OBJ|VAR|AST|DAT|PAG|SKP|CHK|ERR|KBD|PAU|SW|USR)\b
- match: \b(?i:PMC|ORG|REL|TYP|DUM|DEND|END|CHK|DAT|ERR|EXT|EXD|OBJ|VAR|AST|DAT|PAG|SKP|CHK|ERR|KBD|PAU|SW|USR|MAC|EOM)\b
scope: keyword.directive
# IF MX..
@ -113,6 +116,9 @@ contexts:
scope: keyword.directive
set: operand-off
- match: \b(?i:MX)\b
scope: keyword.directive
- match: \b(?i:CAS)\b
scope: keyword.directive
set: operand-cas

View File

@ -0,0 +1,113 @@
%YAML 1.2
---
name: Micol Macro Assembler
scope: source.asm.65816.micol
# https://archive.org/details/Micol-Macro_Assembler_V2.01/
variables:
ws: '[ \t]+'
ident: '[A-Za-z][A-Za-z0-9_]*'
contexts:
prototype:
- include: eol
main:
- meta_include_prototype: false
- match: ^[;]
push:
- meta_scope: comment.line
- match: \n
pop: true
- match: '{{ws}}'
push: opcode
# all labels need an opcode.
# LABEL is a reserved label.
- match: ^{{ident}}
scope: entity.name.label
opcode:
- match: '{{ws}}'
set: operand
- include: scope:source.asm.65816#mnemonics-6502
- include: scope:source.asm.65816#mnemonics-65c02
- include: scope:source.asm.65816#mnemonics-65816
- include: mnemonics-65816-alt
- match: <<<|>>>
scope: keyword.directive
- match: \b(?i:EQU|ORG|PRG|EJT|LST|NLT|NPR|PRI|EMU|I08|I16|M08|M16|NAT)\b
scope: keyword.directive
- match: \b(?i:RES|ABS|ASC|BYT|LWD|WOR)\b
scope: keyword.directive.data
# macro
- match: \b(?i:EXP|MAC|TMC)\b
scope: keyword.directive
- match: \b(?i:CHN|INS)\b
scope: keyword.control.import
set: operand-path
- match: \b(?i:ELS|IFF|STP)\b
scope: keyword.control.conditional
mnemonics-65816-alt:
- match: \b(?i:DEA|INA)\b
scope: keyword.mnemonic.65816.alt
operand:
- include: numbers
- include: strings
# LABFW, LABBK, A, X, Y are reserved labels.
- match: \b(?i:LABEL|LABBK|LABFW|A|X|Y)\b
scope: entity.name.label
# scope: variable.language
# macro parms
- match: \?[0-9A-Za-z]\b
scope: variable.other
operand-path:
- match: \S+
scope: string.unquoted
numbers:
- match: \b\d+\b
scope: constant.numeric
- match: \$[0-9a-fA-F]+\b
scope: constant.numeric.hex
- match: \%[01]+\b
scope: constant.numeric.binary
- match: \@[0-7]+\b
scope: constant.numeric.oct
strings:
- match: "'"
scope: punctuation.definition.string.begin
push:
- meta_include_prototype: false
- meta_scope: string.quoted.single
- match: "'"
scope: punctuation.definition.string.end
pop: true
- match: '\n'
scope: invalid.illegal.newline.asm
pop: true
eol:
- match: '$'
pop: true

View File

@ -0,0 +1,282 @@
%YAML 1.2
---
name: SN Assembler
scope: source.asm.65816.sn
# @ is the default local prefix, but /opt l can change it. : was common.
variables:
ws: '[ \t]+'
ident: '[A-Za-z_.][A-Za-z0-9_.]*'
local: '[@:][A-Za-z0-9_.]+'
contexts:
prototype:
- include: comment
- include: eol
main:
- meta_include_prototype: false
- match: '{{ws}}'
push: opcode
- match: '^({{ident}}){{ws}}((?i)MODULE)\b'
captures:
1: entity.name.function
2: keyword.directive
push: operand
- match: '^({{ident}}){{ws}}((?i)MACRO)\b'
captures:
1: entity.name.function
2: keyword.directive
push: operand-macro
- match: '^{{ident}}'
scope: entity.name.function
- match: '^{{local}}'
scope: entity.name.label.local
- include: comment
opcode:
- match: '{{ws}}'
set: operand
- include: scope:source.asm.65816#mnemonics-6502
- include: scope:source.asm.65816#mnemonics-65c02
- include: scope:source.asm.65816#mnemonics-65c02s
- include: scope:source.asm.65816#mnemonics-65816
- include: mnemonics-65816-alt
- match: \b(?i:DB|DW|DT|DL)\b
scope: keyword.directive
set: operand
- match: \b(?i:HEX)\b
scope: keyword.directive
set: operand
- match: \b(?i:DS|DCB)\b
scope: keyword.directive
set: operand
# reserve space
- match: \b(?i:RSRESET|RSSET|RB|RW)\b
scope: keyword.directive
set: operand
- match: \b(?i:EQU|SET)\b
scope: keyword.directive
set: operand
- match: \b(?i:MACRO|ENDM|MEXIT|SHIFT)\b
scope: keyword.directive
set: operand
- match: \b(?i:SECTION|GRP)\b
scope: keyword.directive
set: operand-section
- match: \b(?i:ORG|END|OPT|MX)\b
scope: keyword.directive
set: operand
- match: \b(?i:XDEF|XREF)\b
scope: keyword.directive
set: operand
- match: \b(?i:ASSUME)\b
scope: keyword.directive
set: operand
- match: \b(?i:MODULE|MODEND)\b
scope: keyword.directive
set: operand
- match: \b(?i:REPT|ENDR)\b
scope: keyword.directive.keyword.control
set: operand
- match: \b(?i:CASE|ENDCASE)\b
scope: keyword.directive.keyword.control
set: operand
- match: \b(?i:WHILE|ENDW)\b
scope: keyword.directive.keyword.control
set: operand
- match: \b(?i:DO|UNTIL)\b
scope: keyword.directive.keyword.control
set: operand
- match: \b(?i:IF|ELSE|ENDIF|ENDC)\b
scope: keyword.directive.keyword.control
set: operand
- match: \b(?i:PUBLIC)\b
scope: keyword.directive
set: operand-on-off
- match: \b(?i:LIST|NOLIST)\b
scope: keyword.directive
set: operand
- match: \b(?i:INFORM)\b
scope: keyword.directive
set: operand
- match: \b(?i:INCLUDE|INCBIN)\b
scope: keyword.directive
set: operand-path
operand:
- include: numbers
- include: strings
- match: \b(?i:__MX|__RS|_RADIX|_RCOUNT|_FILENAME|_CURRENT_FILE|_CURRENT_LINE)\b
scope: keyword.directive
- match: \b(?i:NARG)\b
scope: keyword.directive
- match: \b(?i:_YEAR|_MONTH|_DAY|_WEEKDAY|_HOURS|_MINUTES|_SECONDS)\b
scope: support.constant
- match: \b(?i:DEF|REF|TYPE|STRCMP|STRICMP|STRLEN|SUBSTR|GROUPEND|SECTEND|GROUPORG|SECTSIZE|GROUPSIZE|ALIGNMENT|SECT|OFFSET|FILESIZE|SQRT)\b
scope: support.function
operand-section:
- match: '\b{{ident}}\b'
scope: entity.name.function
set: expect-comment
- include: expect-comment
operand-on-off:
- match: \b(?i:ON|OFF)\b
scope: constant.language
set: expect-comment
- include: expect-comment
operand-ascii:
- meta_include_prototype: false
- match: '{{ws}}'
- match: '([^\r\n|]+)'
scope: string.unquoted
- match: \|
set: comment
- include: eol
operand-fcc:
- match: (\S)
scope: punctuation.definition.string.begin
push:
- meta_include_prototype: false
- meta_scope: string.quoted
- match: \1
scope: punctuation.definition.string.end
pop: true
- match: \n
scope: invalid.illegal
pop: true
operand-path:
- include: strings
operand-macro:
- match: '\b{{ident}}\b'
scope: variable.parameter
# comment char
# ...
# char
operand-comment:
- meta_include_prototype: false
- match: (\S)
scope: punctuation.definition.comment.begin.asm
set: [comment, comment-block]
- match: \n
scope: invalid.illegal.newline.asm
pop: true
comment-block:
- meta_include_prototype: false
- meta_scope: comment.block
- match: \1
scope: punctuation.definition.comment.end.asm
pop: true # pops to comment.
numbers:
- match: \b\d+\b
scope: constant.numeric
- match: \$[0-9a-fA-F]+\b
scope: constant.numeric.hex
- match: \%[01]+\b
scope: constant.numeric.binary
strings:
- match: "'"
scope: punctuation.definition.string.begin
push:
- meta_include_prototype: false
- meta_scope: string.quoted.single
- match: "'"
scope: punctuation.definition.string.end
pop: true
- match: \n
scope: invalid.illegal.newline.asm
pop: true
- match: '"'
scope: punctuation.definition.string.begin
push:
- meta_include_prototype: false
- meta_scope: string.quoted.double
- match: '"'
scope: punctuation.definition.string.end
pop: true
- match: \n
scope: invalid.illegal.newline.asm
pop: true
expect-comment:
- include: comment
- match: \S
scope: invalid.illegal.expect.comment
comment:
- match: ;
push:
- meta_scope: comment.line.partial
- match: \n
pop: true
- include: eol
mnemonics-65816-alt:
- match: \b(?i:BLT|BGE|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\b
scope: keyword.mnemonic.65816.alt
eol:
- match: '$'
pop: true

View File

@ -1,6 +1,7 @@
%YAML 1.2
---
name: CA65
file_extensions: []
scope: source.asm.ca65
variables:
@ -240,3 +241,13 @@ contexts:
- match: \b(?i:RTN|SET|LD|LDD|ST|STD|POP|POPD|STP|ADD|SUB|CPR|INR|DCR|BR|BNC|BC|BP|BM|BZ|BNZ|BM1|BNM1|BK|RS|BS)\b
scope: keyword.mnemonic.sweet16
set: operand
mnemonics-macpack-generic:
- match: \b(?i:ADD|SUB|BGE|BLT|BGT|BLE|BNZ|BZE)\b
scope: keyword.mnemonic.macpack.generic
set: operand
mnemonics-macpack-longbranch:
- match: \b(?i:JEQ|JNE|JMI|JPL|JCS|JCC|JVS|JVC)\b
scope: keyword.mnemonic.macpack.longbranch
set: operand

View File

@ -0,0 +1,220 @@
%YAML 1.2
---
name: S-C Assembler
file_extensions: []
scope: source.asm.sc-asm
variables:
ws: '[ \t]+'
xws: '[ \t\x08]*'
ident: '[A-Za-z][A-Za-z0-9.]*'
lident: '.[0-9]{1,2}'
contexts:
prototype:
- include: eol
main:
- meta_include_prototype: false
- match: ^[*]
push:
- meta_scope: comment.line
- match: \n
pop: true
# assembler commands. there are others but these are used by a2osx...
- match: '^{{xws}}((?i)NEW|AUTO|MANUAL|MAN|ASM)\b'
captures:
1: keyword.directive
# scope: keyword.directive
push:
- match: $
pop: true
- match: '^{{xws}}((?i)SAVE|LOAD)\b'
captures:
1: keyword.directive
# scope: keyword.directive
push: operand-path
- match: '{{ws}}'
push: opcode
- match: '^{{ws}}((?i)\.MA)\s({{ident}})'
captures:
2: keyword.directive
1: entity.name.function
push: eol
- match: '^({{ident}}){{ws}}\.((?i)EQ)\b'
captures:
1: entity.name.constant
2: keyword.directive
push: operand
- match: '^{{lident}}'
scope: entity.name.label.local
- match: '^{{ident}}'
scope: entity.name.function
opcode:
- match: '{{ws}}'
set: operand
- include: scope:source.asm.65816#mnemonics-6502
- include: scope:source.asm.65816#mnemonics-65c02
- include: scope:source.asm.65816#mnemonics-65c02s
- include: scope:source.asm.65816#mnemonics-65816
- include: mnemonics-6502-alt
- match: \.(?i:DA)\b
scope: keyword.directive.data
set: operand
- match: \.(?i:HS)\b
scope: keyword.directive.data
set: operand-hex
- match: \.(?i:AS|AT|AZ)\b
scope: keyword.directive.data
set: operand-string
- match: \.(?i:OP)\b
scope: keyword.directive
set: operand-op
- match: \.(?i:INB|IN|TF)\b
scope: keyword.control.import
set: operand-path
- match: \.(?i:LIST)\b
scope: keyword.directive
set: operand-list
- match: \.(?i:AC|AS|AT|AZ|BS|DA|DO|DUMMY|ED|ELSE|EM|EN|EP|EQ|FIN|HS|IN|INB|LIST|MA|OP|OR|PG|PH|TA|TF|TI|US)\b
scope: keyword.directive
- match: '>{{ident}}'
scope: variable.function.macro
set: operand
operand:
- include: numbers
- include: strings
- match: ']\d+'
scope: variable.other
#- include: macro-parm
operand-op:
- match: '(?i:6502|SW16|65C02|65R02|65802|65816)'
scope: constant.language
set: comment
- include: error
operand-hex:
- match: '[0-9A-Fa-f]{2}'
scope: constant.numeric.hex
- include: expect-comment
operand-path:
- match: \S+
scope: string.unquoted
set: expect-comment
- include: expect-comment
# -? delimiter (anything but delimiter)* delimiter
# pop: 1 needed for \1 backref matching.
operand-string:
- match: '-?([^ \t-])'
scope: punctuation.definition.string.begin
push: [comment, operand-string-inner]
# - include: expect-comment
operand-string-inner:
- meta_scope: string.quoted
- match: \1
scope: punctuation.definition.string.end
pop: true
operand-list:
# .LIST ON | OFF | CON | COFF | MON | MOFF | XON | XOFF
- match: \b(?i:[CMX]?ON|[CMX]?OFF)\b
scope: constant.language
set: comment
- include: error
error:
- match: \S
scope: invalid.illegal.expect.comment
expect-comment:
- include: comment
- match: \S
scope: invalid.illegal.expect.comment
comment:
- match: (?<=[\t ])
push:
- meta_scope: comment.line
- match: \n
pop: true
- include: eol
mnemonics-6502-alt:
- match: \b(?i:BLT|BGE)\b
scope: keyword.mnemonic.6502.alt
numbers:
- match: \b\d+\b
scope: constant.numeric
- match: \$[0-9a-fA-F]+\b
scope: constant.numeric.hex
- match: \%[01_]+\b
scope: constant.numeric.binary
strings:
- match: "'"
scope: punctuation.definition.string.begin
push:
- meta_include_prototype: false
- meta_scope: string.quoted.single
- match: "'"
scope: punctuation.definition.string.end
pop: true
- match: \n
scope: invalid.illegal.newline.asm
pop: true
eol:
- match: '$'
pop: true

524
mac-gen.py Normal file
View File

@ -0,0 +1,524 @@
import sublime
import sublime_plugin
import os
import re
import sys
import time
def each_line(file):
f = open(file, "r", encoding="ascii")
try:
while True:
x = f.readline()
if not x: break
x = x.rstrip("\r\n")
yield x
except Exception as e:
raise e
finally:
f.close()
def macro_files(dirs, filter):
rv = []
for root in dirs:
try:
tmp = [x for x in os.listdir(root) if filter(x)]
tmp.sort(key=str.upper)
tmp = [os.path.join(root, x) for x in tmp]
tmp = [x for x in tmp if os.path.isfile(x)]
rv += tmp
except Exception as e:
pass
return rv
re_pmc = re.compile('^[^.,/\\- ]*')
re_dot_s = re.compile('\\.S$', re.IGNORECASE)
re_ws = re.compile('[\t ]+')
re_comment = re.compile('^[\t ]*[;*]')
class MerlinMacGen(sublime_plugin.TextCommand):
opcodes = {
'BRL', 'COP', 'JML', 'JMPL', 'JSL', 'MVN', 'MVP', 'MX', 'PEA',
'PEI', 'PER', 'REP', 'SEP', 'WDM', 'XCE', 'ADR', 'ADRL', 'ASC',
'AST', 'BRK', 'CHK', 'CYC', 'DA', 'DAT', 'DB', 'DCI', 'DDB', 'DEND',
'DFB', 'DL', 'DS', 'DSK', 'DUM', 'DW', 'END', 'ENT', 'EQU', 'ERR', 'EXP',
'EXT', 'FLS', 'HEX', 'INV', 'KBD', 'LST', 'LSTL', 'LUP', 'OBJ',
'ORG', 'PAG', 'PAU', 'PMC', 'PUT', 'REL', 'REV', 'SAV', 'SKP',
'STR', 'TR', 'TTL', 'TYP', 'USE', 'USR', 'VAR', 'XC', 'XREF','=',
'>>>', 'DO', 'ELS', 'EOM', 'FIN', 'IF', 'MAC', '--^', '<<<',
'CLC', 'CLD', 'CLI', 'CLV', 'DEX', 'DEY', 'INX', 'INY', 'NOP',
'PHA', 'PHB', 'PHD', 'PHK', 'PHX', 'PHY', 'PLA', 'PLB', 'PLD',
'PLP', 'PLX', 'PLY', 'RTI', 'RTL', 'RTS', 'SEC', 'SED', 'SEI',
'STP', 'SWA', 'TAD', 'TAS', 'TAX', 'TAY', 'TCD', 'TCS', 'TDA',
'TDC', 'TSA', 'TSC', 'TSX', 'TXA', 'TXS', 'TXY', 'TYA', 'TYX',
'WAI', 'XBA', 'BCC', 'BCS', 'BEQ', 'BGE', 'BLT', 'BMI', 'BNE',
'BPL', 'BRA', 'BVC', 'BVS', 'ADCL', 'ANDL', 'CMPL', 'EORL',
'LDAL', 'ORAL', 'SBCL', 'STAL', 'ADC', 'AND', 'ASL', 'BIT',
'CMP', 'CPX', 'CPY', 'DEC', 'EOR', 'INC', 'JMP', 'JSR', 'LDA',
'LDX', 'LDY', 'LSR', 'ORA', 'ROL', 'ROR', 'SBC', 'STA', 'STX',
'STY', 'STZ', 'TRB', 'TSB', 'PHP', 'STRL', 'FLO', 'EXD', 'CAS',
''
}
def front_matter(self):
buffer = ""
name = self.view.file_name()
if name:
buffer += "* Generated from " + os.path.basename(name) + " on " + time.asctime() + "\n"
else:
buffer += "* Generated on " + time.asctime() + "\n"
buffer += "\n"
return buffer
def missing_matter(self, missing):
buffer = ""
if len(missing) == 0:
return ""
buffer = "* Missing Macros\n"
missing = list(missing)
missing.sort
for macro in missing:
buffer += "* " + macro + "\n"
buffer += "\n"
return buffer
def run(self, edit):
view = self.view
missing = set()
known = set()
self.build_missing(known, missing)
if len(missing) == 0: return
buffer = ""
dirlist = view.settings().get('merlin_macro_directories', [])
files = macro_files(dirlist, lambda x: x[-2:].upper() == ".S")
print(files)
for f in files:
buffer += self.one_macro_file(f, known, missing)
if len(missing) == 0: break;
buffer = self.front_matter() + self.missing_matter(missing) + buffer
view = view.window().new_file()
view.insert(edit, 0, buffer)
def build_missing(self, known, missing):
view = self.view
all = sublime.Region(0, view.size())
for r in view.lines(all):
text = view.substr(r).rstrip()
if text == "" or re_comment.match(text):
continue
tokens = re.split(re_ws, text, maxsplit=2)
if len(tokens) < 2:
continue
# _macro args
# PMC _macro,args << . / , - ( Space are separtors.
# >>> _macro
label = tokens[0].upper()
opcode = tokens[1].upper()
if opcode == "" or opcode[0] == ";":
continue
if opcode == 'MAC':
# label MAC
if label != "":
known.add(label)
continue
if opcode in {'PMC', '>>>'} and len(tokens) > 2:
tmp = tokens[2].upper()
opcode = re_pmc.match(tmp).group(0)
if opcode == "":
continue
if opcode in self.opcodes:
continue
if opcode in known:
continue
missing.add(opcode)
def one_macro_file(self, file, known, missing):
inmac = False
buffer = ""
for text in each_line(file):
text = text.rstrip()
if inmac:
buffer += text + "\n"
if text == "": continue
if re_comment.match(text): continue
tokens = re.split(re_ws, text, maxsplit=2)
if len(tokens) < 2: continue
label = tokens[0].upper()
opcode = tokens[1].upper()
if opcode == "" or opcode[0] == ";": continue
if opcode == "MAC" and label != "":
# print(label,file=sys.stderr)
# print(label in missing, file=sys.stderr)
if inmac:
known.add(label)
missing.discard(label)
elif label in missing:
inmac = True
known.add(label)
missing.discard(label)
buffer += text + "\n"
continue
if opcode in { '<<<', 'EOM' }:
inmac = False
continue
if not inmac: continue
if opcode in {'PMC', '>>>'} and len(tokens) > 2:
tmp = tokens[2].upper()
opcode = re_pmc.match(tmp).group(0)
if opcode == "":
continue
if opcode in self.opcodes: continue
if opcode in known: continue
missing.add(opcode)
return buffer
class OrcaMacGen(sublime_plugin.TextCommand):
opcodes = {
'ADC', 'AND', 'CMP', 'EOR', 'LDA', 'ORA', 'SBC', 'ASL', 'LSR',
'ROR', 'ROL', 'BIT', 'CPX', 'CPY', 'DEC', 'INC', 'LDX', 'LDY',
'STA', 'STX', 'STY', 'JMP', 'JSR', 'STZ', 'TRB', 'TSB', 'JSL',
'JML', 'COP', 'MVN', 'MVP', 'PEA', 'PEI', 'REP', 'SEP', 'PER',
'BRL', 'BRA', 'BEQ', 'BMI', 'BNE', 'BPL', 'BVC', 'BVS', 'BCC',
'BCS', 'CLI', 'CLV', 'DEX', 'DEY', 'INX', 'INY', 'NOP', 'PHA',
'PLA', 'PHP', 'PLP', 'RTI', 'RTS', 'SEC', 'SED', 'SEI', 'TAX',
'TAY', 'TSX', 'TXA', 'TXS', 'TYA', 'BRK', 'CLC', 'CLD', 'PHX',
'PHY', 'PLX', 'PLY', 'DEA', 'INA', 'PHB', 'PHD', 'PHK', 'PLB',
'PLD', 'WDM', 'RTL', 'STP', 'TCD', 'TCS', 'TDC', 'TSC', 'TXY',
'TYX', 'WAI', 'XBA', 'XCE', 'CPA', 'BLT', 'BGE', 'GBLA', 'GBLB',
'GBLC', 'LCLA', 'LCLB', 'LCLC', 'SETA', 'SETB', 'SETC', 'AMID',
'ASEARCH', 'AINPUT', 'AIF', 'AGO', 'ACTR', 'MNOTE', 'ANOP', 'DS',
'ORG', 'OBJ', 'EQU', 'GEQU', 'MERR', 'DIRECT', 'KIND', 'SETCOM',
'EJECT', 'ERR', 'GEN', 'MSB', 'LIST', 'SYMBOL', 'PRINTER',
'65C02', '65816', 'LONGA', 'LONGI', 'DATACHK', 'CODECHK',
'DYNCHK', 'IEEE', 'NUMSEX', 'CASE', 'OBJCASE', 'ABSADDR',
'INSTIME', 'TRACE', 'EXPAND', 'DC', 'USING', 'ENTRY', 'OBJEND',
'DATA', 'PRIVDATA', 'END', 'ALIGN', 'START', 'PRIVATE', 'MEM',
'TITLE', 'RENAME', 'KEEP', 'COPY', 'APPEND', 'MCOPY', 'MDROP',
'MLOAD', 'MACRO', 'MEXIT', 'MEND'
}
def run(self, edit):
view = self.view
known = set()
missing = set()
self.build_missing(known, missing)
if len(missing) == 0: return
buffer = ""
dirlist = view.settings().get('orca_macro_directories', [])
files = macro_files(dirlist, lambda x: x[:4].upper() == "M16.")
#print(files)
for f in files:
buffer += self.one_macro_file(f, known, missing)
if len(missing) == 0: break;
buffer = self.front_matter() + self.missing_matter(missing) + buffer
view = view.window().new_file()
view.insert(edit, 0, buffer)
def build_missing(self, known, missing):
view = self.view
all = sublime.Region(0, view.size())
for r in view.lines(all):
text = view.substr(r).rstrip()
if text == "": continue
if text[0] in "!*": continue
if re_comment.match(text): continue
tokens = re.split(re_ws, text, maxsplit=2)
if len(tokens) < 2: continue
label = tokens[0].upper()
opcode = tokens[1].upper()
if opcode in self.opcodes: continue
missing.add(opcode)
def one_macro_file(self, file, known, missing):
buffer = ""
state = 0
for text in each_line(file):
if state == 2:
buffer += text + "\n"
if text == "": continue
if re_comment.match(text): continue
tokens = re.split(re_ws, text, maxsplit=2)
if len(tokens) < 2: continue
label = tokens[0].upper()
opcode = tokens[1].upper()
if state == 0:
if opcode == 'MACRO': state = 1
elif state == 1:
if opcode in missing:
known.add(opcode)
missing.discard(opcode)
buffer += "\tMACRO\n"
buffer += text + "\n"
state = 2
else:
state = 0
elif state == 2:
if opcode == 'MEND': state = 0
if opcode not in self.opcodes and opcode not in known:
missing.add(opcode)
return buffer
def front_matter(self):
buffer = ""
name = self.view.file_name()
if name:
buffer += "* Generated from " + os.path.basename(name) + " on " + time.asctime() + "\n"
else:
buffer += "* Generated on " + time.asctime() + "\n"
buffer += "\n"
return buffer
def missing_matter(self, missing):
buffer = ""
if len(missing) == 0:
return ""
buffer = "* Missing Macros\n"
missing = list(missing)
missing.sort
for macro in missing:
buffer += "* " + macro + "\n"
buffer += "\n"
return buffer
class MpwMacGen(sublime_plugin.TextCommand):
opcodes = {
'ACTR', 'ADC', 'AERROR', 'ALIGN', 'AND', 'ANOP', 'ASL',
'BBC0', 'BBC1', 'BBC2', 'BBC3', 'BBC4', 'BBC5', 'BBC6', 'BBC7',
'BBR0', 'BBR1', 'BBR2', 'BBR3', 'BBR4', 'BBR5', 'BBR6', 'BBR7',
'BBS0', 'BBS1', 'BBS2', 'BBS3', 'BBS4', 'BBS5', 'BBS6', 'BBS7',
'BCC', 'BCS', 'BEQ', 'BGE', 'BIT', 'BLANKS', 'BLT', 'BMI', 'BNE',
'BPL', 'BRA', 'BRK', 'BRL', 'BVC', 'BVS', 'CASE',
'CLB0', 'CLB1', 'CLB2', 'CLB3', 'CLB4', 'CLB5', 'CLB6', 'CLB7',
'CLC', 'CLD', 'CLI', 'CLT', 'CLV', 'CMP', 'CODECHK', 'COM', 'COP', 'CPA',
'CPX', 'CPY', 'CYCLE', 'DATACHK', 'DC', 'DCB', 'DS', 'DEA', 'DEC', 'DEX', 'DEY',
'DIRECT', 'DUMP', 'EJECT', 'ELSE', 'ELSEIF', 'END', 'ENDF', 'ENDFUNC',
'ENDI', 'ENDIF', 'ENDINIT', 'ENDM', 'ENDMACRO', 'ENDP', 'ENDPROC',
'ENDR', 'ENDS', 'ENDSTACK', 'ENDW', 'ENDWHILE', 'ENDWITH', 'ENTRY',
'EOR', 'EQU', 'EXITM', 'EXPORT', 'FUNC', 'GBLA', 'GBLC', 'GOTO',
'IF', 'IMPORT', 'INA', 'INC', 'INCLUDE', 'INIT', 'INX', 'INY', 'JML', 'JMP',
'JSL', 'JSR', 'LCLA', 'LCLC', 'LDA', 'LDM', 'LDX', 'LDY', 'LEAVE',
'LOAD', 'LONGA', 'LONGI', 'LSR', 'MACHINE', 'MACRO', 'MEND', 'MEXIT',
'MSB', 'MVN', 'MVP', 'NOP', 'ORA', 'ORG', 'PAGESIZE', 'PEA', 'PEI',
'PER', 'PHA', 'PHB', 'PHD', 'PHK', 'PHP', 'PHX', 'PHY', 'PLA', 'PLB',
'PLD', 'PLP', 'PLX', 'PLY', 'PRINT', 'PROC', 'RECORD', 'REP', 'RMB0',
'RMB1', 'RMB2', 'RMB3', 'RMB4', 'RMB5', 'RMB6', 'RMB7', 'ROL', 'ROR',
'RRF', 'RTI', 'RTL', 'RTS', 'SBC', 'SEB0', 'SEB1', 'SEB2', 'SEB3',
'SEB4', 'SEB5', 'SEB6', 'SEB7', 'SEC', 'SED', 'SEG', 'SEGATTR', 'SEI',
'SEP', 'SET', 'SETA', 'SETC', 'SETT', 'SMB0', 'SMB1', 'SMB2', 'SMB3',
'SMB4', 'SMB5', 'SMB6', 'SMB7', 'SPACE', 'STA', 'STACKDP', 'STP',
'STRING', 'STX', 'STY', 'STZ', 'SWA', 'TAD', 'TAS', 'TAX', 'TAY', 'TCD',
'TCS', 'TDA', 'TDC', 'TITLE', 'TRB', 'TSA', 'TSB', 'TSC', 'TST', 'TSX',
'TXA', 'TXS', 'TXY', 'TYA', 'TYX', 'WAI', 'WHILE', 'WITH', 'WRITE',
'WRITELN', 'XBA', 'XCE'
}
def run(self, edit):
view = self.view
known = set()
missing = set()
self.build_missing(known, missing)
if len(missing) == 0: return
buffer = ""
dirlist = view.settings().get('mpw_macro_directories', [])
files = macro_files(dirlist, lambda x: x[:4].upper() == "M16.")
#print(files)
for f in files:
buffer += self.one_macro_file(f, known, missing)
if len(missing) == 0: break;
buffer = self.front_matter() + self.missing_matter(missing) + buffer
view = view.window().new_file()
view.insert(edit, 0, buffer)
def build_missing(self, known, missing):
state = 0
view = self.view
all = sublime.Region(0, view.size())
for r in view.lines(all):
text = view.substr(r).rstrip()
if text == "": continue
if re_comment.match(text): continue
tokens = re.split(re_ws, text, maxsplit=2)
if len(tokens) < 2: continue
label = tokens[0].upper()
opcode = tokens[1].upper()
ix = opcode.find('.')
if ix >= 0: opcode = opcode[:ix]
if opcode == "MACRO":
state = 1
continue
if opcode == "MEND":
state = 0
continue
if state == 1:
known.add(opcode)
missing.discard(opcode)
state = 0
continue
if opcode in self.opcodes: continue
if opcode in known: continue
missing.add(opcode)
def one_macro_file(self, file, known, missing):
buffer = ""
state = 0
for text in each_line(file):
if state == 2:
buffer += text + "\n"
if text == "": continue
if re_comment.match(text): continue
tokens = re.split(re_ws, text, maxsplit=2)
if len(tokens) < 2: continue
label = tokens[0].upper()
opcode = tokens[1].upper()
if state == 0:
if opcode == 'MACRO': state = 1
elif state == 1:
if opcode in missing:
known.add(opcode)
missing.discard(opcode)
buffer += "\tMACRO\n"
buffer += text + "\n"
state = 2
else:
state = 0
elif state == 2:
if opcode == 'MEND': state = 0
if opcode not in self.opcodes and opcode not in known:
missing.add(opcode)
return buffer
def front_matter(self):
buffer = ""
name = self.view.file_name()
if name:
buffer += "* Generated from " + os.path.basename(name) + " on " + time.asctime() + "\n"
else:
buffer += "* Generated on " + time.asctime() + "\n"
buffer += "\n"
return buffer
def missing_matter(self, missing):
buffer = ""
if len(missing) == 0:
return ""
buffer = "* Missing Macros\n"
missing = list(missing)
missing.sort
for macro in missing:
buffer += "* " + macro + "\n"
buffer += "\n"
return buffer

86
merlin-fixs.py Normal file
View File

@ -0,0 +1,86 @@
import sublime
import sublime_plugin
SPACE = [" ", "\t"]
QUOTES = ["'", '"']
#
# need to do something clever for ; comments to put in comment field?
#
def fixs(s):
f = 0
q = None
sp = False
comment = False
rv = ''
if not len(s): return s
if s[0] == "*": comment = True
if s[0] == ";": comment = True ; rv = "\t\t\t"
for c in s:
if comment:
if c == "\t": c = " "
rv += c
continue
if q:
rv += c
if c == q: q = None
continue
if c in QUOTES:
rv += c
q = c
sp = False
continue
if c in SPACE:
if sp: continue
f += 1
c = "\t"
sp = True
rv += c
continue
if sp:
if c == ';':
comment = True
rv += "\t" * (3-f)
elif f == 3:
comment = True
rv += "; "
sp = False
rv += c
return rv;
class MerlinFixs(sublime_plugin.TextCommand):
def is_enabled(self):
scope = self.view.scope_name(0)
lang = scope.split(' ')[0]
return lang == 'source.asm.65816.merlin' or lang == "source.linker.merlin"
def run(self, edit):
view = self.view
all = sublime.Region(0, view.size())
# disable space indentation.
view.settings().set('translate_tabs_to_spaces', False)
data = []
for r in view.lines(all):
text = view.substr(r).rstrip()
data.append(fixs(text))
data.append('')
text = '\n'.join(data)
view.replace(edit, all, text)

View File

@ -1,208 +0,0 @@
import sublime
import sublime_plugin
import os
import re
import sys
import time
class MerlinMacGen(sublime_plugin.TextCommand):
opcodes = {
'BRL', 'COP', 'JML', 'JMPL', 'JSL', 'MVN', 'MVP', 'MX', 'PEA',
'PEI', 'PER', 'REP', 'SEP', 'WDM', 'XCE', 'ADR', 'ADRL', 'ASC',
'AST', 'BRK', 'CHK', 'CYC', 'DA', 'DAT', 'DB', 'DCI', 'DDB', 'DEND',
'DFB', 'DL', 'DS', 'DSK', 'DUM', 'DW', 'END', 'ENT', 'EQU', 'ERR', 'EXP',
'EXT', 'FLS', 'HEX', 'INV', 'KBD', 'LST', 'LSTL', 'LUP', 'OBJ',
'ORG', 'PAG', 'PAU', 'PMC', 'PUT', 'REL', 'REV', 'SAV', 'SKP',
'STR', 'TR', 'TTL', 'TYP', 'USE', 'USR', 'VAR', 'XC', 'XREF','=',
'>>>', 'DO', 'ELS', 'EOM', 'FIN', 'IF', 'MAC', '--^', '<<<',
'CLC', 'CLD', 'CLI', 'CLV', 'DEX', 'DEY', 'INX', 'INY', 'NOP',
'PHA', 'PHB', 'PHD', 'PHK', 'PHX', 'PHY', 'PLA', 'PLB', 'PLD',
'PLP', 'PLX', 'PLY', 'RTI', 'RTL', 'RTS', 'SEC', 'SED', 'SEI',
'STP', 'SWA', 'TAD', 'TAS', 'TAX', 'TAY', 'TCD', 'TCS', 'TDA',
'TDC', 'TSA', 'TSC', 'TSX', 'TXA', 'TXS', 'TXY', 'TYA', 'TYX',
'WAI', 'XBA', 'BCC', 'BCS', 'BEQ', 'BGE', 'BLT', 'BMI', 'BNE',
'BPL', 'BRA', 'BVC', 'BVS', 'ADCL', 'ANDL', 'CMPL', 'EORL',
'LDAL', 'ORAL', 'SBCL', 'STAL', 'ADC', 'AND', 'ASL', 'BIT',
'CMP', 'CPX', 'CPY', 'DEC', 'EOR', 'INC', 'JMP', 'JSR', 'LDA',
'LDX', 'LDY', 'LSR', 'ORA', 'ROL', 'ROR', 'SBC', 'STA', 'STX',
'STY', 'STZ', 'TRB', 'TSB', 'PHP', 'STRL', 'FLO', 'EXD', 'CAS',
''
}
re_pmc = re.compile('^[^.,/\\- ]*')
re_dot_s = re.compile('\\.S$', re.IGNORECASE)
re_ws = re.compile('[\t ]+')
re_comment = re.compile('^[\t ]*[;*]')
def front_matter(self):
buffer = ""
name = self.view.file_name()
if name:
buffer += "* Generated from " + os.path.basename(name) + " on " + time.asctime() + "\n"
else:
buffer += "* Generated on " + time.asctime() + "\n"
buffer += "\n"
return buffer
def missing_matter(self, missing):
buffer = ""
if len(missing) == 0:
return ""
buffer = "* Missing Macros\n"
missing = list(missing)
missing.sort
for macro in missing:
buffer += "* " + macro + "\n"
buffer += "\n"
return buffer
def run(self, edit):
missing = set()
known = set()
view = self.view
all = sublime.Region(0, view.size())
for r in view.lines(all):
text = view.substr(r).rstrip()
if text == "" or self.re_comment.match(text):
continue
line = re.split(self.re_ws, text, maxsplit=2)
if len(line) < 2:
continue
# _macro args
# PMC _macro,args << . / , - ( Space are separtors.
# >>> _macro
label = line[0].upper()
opcode = line[1].upper()
if opcode == "" or opcode[0] == ";":
continue
if opcode == 'MAC':
# label MAC
if label != "":
known.add(label)
continue
if opcode in {'PMC', '>>>'} and len(line) > 2:
tmp = line[2].upper()
opcode = self.re_pmc.match(tmp).group(0)
if opcode == "":
continue
if opcode in self.opcodes:
continue
if opcode in known:
continue
missing.add(opcode)
if len(missing) == 0:
return
#
buffer = ""
root = "/tmp/supermacs"
for e in os.listdir(root):
if not self.re_dot_s.search(e):
continue
path = os.path.join(root, e)
if not os.path.isfile(path):
continue
with open(path,'r') as file:
# print(e + "\n",file=sys.stderr)
buffer += self.one_macro_file(file, known, missing)
if len(missing) == 0:
break
buffer = self.front_matter() + self.missing_matter(missing) + buffer
view = view.window().new_file()
view.insert(edit, 0, buffer)
# p = 0
# for m in missing:
# p = p + view.insert(edit, p, str(m) + "\n")
def one_macro_file(self, file, known, missing):
inmac = False
buffer = ""
while True:
text = file.readline()
if not text:
return buffer
text = text.rstrip()
if inmac:
buffer += text + "\n"
if text == "" or self.re_comment.match(text):
continue
line = re.split(self.re_ws, text, maxsplit=2)
if len(line) < 2:
continue
# if line[0] == "_MMStartUp":
# print(line, file=sys.stderr)
label = line[0].upper()
opcode = line[1].upper()
if opcode == "" or opcode[0] == ";":
continue
if opcode == "MAC" and label != "":
# print(label,file=sys.stderr)
# print(label in missing, file=sys.stderr)
if inmac:
known.add(label)
missing.discard(label)
elif label in missing:
inmac = True
known.add(label)
missing.discard(label)
buffer += text + "\n"
continue
if opcode in { '<<<', 'EOM' }:
inmac = False
continue
if not inmac:
continue
if opcode in {'PMC', '>>>'} and len(line) > 2:
tmp = line[2].upper()
opcode = self.re_pmc.match(tmp).group(0)
if opcode == "":
continue
if opcode in self.opcodes:
continue
if opcode in known:
continue
missing.add(opcode)

View File

@ -0,0 +1,34 @@
{
"scope": "source.asm.sc-asm meta.directive",
"completions":
[
".ac",
".as",
".at",
".az",
".bs",
".da",
".do",
".dummy",
".ed",
".else",
".em",
".en",
".ep",
".eq",
".fin",
".hs",
".in",
".inb",
".list",
".ma",
".op",
".or",
".pg",
".ph",
".ta",
".tf",
".ti",
".us"
]
}