mirror of
https://github.com/ksherlock/65816.tmbundle.git
synced 2026-04-22 05:16:56 +00:00
Adds support for block comments in ca65 source, with tests.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
%YAML 1.2
|
||||
---
|
||||
name: CA65
|
||||
file_extensions: []
|
||||
file_extensions: [s, asm, assembly]
|
||||
scope: source.asm.ca65
|
||||
|
||||
variables:
|
||||
@@ -12,9 +12,26 @@ contexts:
|
||||
- match: $
|
||||
pop: true
|
||||
|
||||
comment:
|
||||
- match: ;
|
||||
scope: punctuation.definition.comment.ca65
|
||||
push:
|
||||
- meta_include_prototype: false
|
||||
- meta_scope: comment.line.ca65
|
||||
- match: \n
|
||||
pop: true
|
||||
- match: /\*
|
||||
scope: punctuation.definition.comment.begin.ca65
|
||||
push:
|
||||
- meta_include_prototype: false
|
||||
- meta_scope: comment.block.ca65
|
||||
- match: \*/
|
||||
scope: punctuation.definition.comment.end.ca65
|
||||
pop: true
|
||||
|
||||
main:
|
||||
- meta_include_prototype: false
|
||||
|
||||
- include: comment
|
||||
|
||||
- match: \b({{ident}})\s*(:?=)
|
||||
push: operand
|
||||
@@ -22,7 +39,6 @@ contexts:
|
||||
1: entity.name.constant.ca65
|
||||
2: keyword.operator.assignment.ca65
|
||||
|
||||
|
||||
- match: '\b{{ident}}:'
|
||||
scope: entity.name.label
|
||||
push: opcode
|
||||
@@ -35,14 +51,6 @@ contexts:
|
||||
scope: entity.name.label.anonymous
|
||||
oush: opcode
|
||||
|
||||
- match: ;
|
||||
scope: punctuation.definition.comment.ca65
|
||||
push:
|
||||
- meta_include_prototype: false
|
||||
- meta_scope: comment.line.ca65
|
||||
- match: \n
|
||||
pop: true
|
||||
|
||||
- match: (\.(?i:proc))\s+({{ident}})\b
|
||||
captures:
|
||||
1: keyword.ca65
|
||||
@@ -82,8 +90,6 @@ contexts:
|
||||
- match: \S
|
||||
scope: invalid.illegal
|
||||
|
||||
|
||||
|
||||
opcode:
|
||||
- meta_content_scope: meta.opcode
|
||||
- include: directives
|
||||
@@ -177,16 +183,6 @@ contexts:
|
||||
- match: \%[01]+\b
|
||||
scope: constant.numeric.binary.ca65
|
||||
|
||||
|
||||
comment:
|
||||
- match: ;
|
||||
scope: punctuation.definition.comment.ca65
|
||||
push:
|
||||
- meta_include_prototype: false
|
||||
- meta_scope: comment.line.ca65
|
||||
- match: \n
|
||||
pop: true
|
||||
|
||||
strings:
|
||||
- match: '"'
|
||||
scope: punctuation.definition.string.begin.ca65
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
; SYNTAX TEST "Packages/65816.tmbundle/Syntaxes/ca65.sublime-syntax"
|
||||
|
||||
; foo
|
||||
; ^ source.asm.ca65 comment.line
|
||||
; <- punctuation.definition.comment
|
||||
|
||||
/* something */
|
||||
; ^ source.asm.ca65 comment.block
|
||||
; <- punctuation.definition.comment.begin
|
||||
; ^ punctuation.definition.comment.end
|
||||
Reference in New Issue
Block a user