Skip to content

Commit fc04159

Browse files
committed
Add module definitions
1 parent f8beed6 commit fc04159

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

Coi.sublime-syntax

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ contexts:
2525
- include: enum-definitions
2626
- include: event-definitions
2727
- include: function-definitions
28+
- include: module-definitions
2829
- include: router-definitions
2930
- include: style-definitions
3031
- include: type-definitions
@@ -386,6 +387,20 @@ contexts:
386387
pop: 1
387388
- include: statements
388389

390+
###[ MODULE DEFINITIONS ]######################################################
391+
392+
module-definitions:
393+
- match: module\b
394+
scope: meta.namespace.module.coi keyword.declaration.module.coi
395+
push: module-name
396+
397+
module-name:
398+
- meta_content_scope: meta.namespace.module.coi
399+
- match: '{{component_name}}'
400+
scope: meta.namespace.module.identifier.coi entity.name.namespace.module.coi
401+
pop: 1
402+
- include: else-pop
403+
389404
###[ ROUTER DEFINITIONS ]######################################################
390405

391406
router-definitions:

Symbol List.tmPreferences

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<dict>
44
<key>scope</key>
55
<string>
6+
source.coi entity.name.namespace,
67
source.coi entity.name.class.component,
78
source.coi entity.name.constant
89
</string>

tests/syntax_test_scope.coi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,19 @@ def funcName(string arg, int[] count = 10): string { }
672672
// ^ punctuation.section.block.begin.coi
673673
// ^ punctuation.section.block.end.coi
674674

675+
/// [ MODULE DEFINITIONS ]/////////////////////////////////////////////////////
676+
677+
module
678+
// <- meta.namespace.module.coi keyword.declaration.module.coi
679+
//^^^^^ meta.namespace.module.coi
680+
//^^^^ keyword.declaration.module.coi
681+
682+
module Name
683+
// <- meta.namespace.module.coi keyword.declaration.module.coi
684+
//^^^^^ meta.namespace.module.coi
685+
//^^^^ keyword.declaration.module.coi
686+
// ^^^^ meta.namespace.module.identifier.coi entity.name.namespace.module.coi
687+
675688
/// [ ROUTER DEFINITIONS ]/////////////////////////////////////////////////////
676689

677690
router {

0 commit comments

Comments
 (0)