Adds support for block comments in ca65 source, with tests.

This commit is contained in:
Ryan Harter
2026-03-05 21:32:44 -06:00
parent 8aafb4b178
commit c04d8c3865
2 changed files with 29 additions and 23 deletions
+19 -23
View File
@@ -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
+10
View File
@@ -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