Skip to content

Commit d2871e7

Browse files
committed
Added syntax for .fnt files
1 parent 2122577 commit d2871e7

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

Font.sublime-syntax

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
%YAML 1.2
2+
---
3+
name: Crackshell Font
4+
file_extensions:
5+
- fnt
6+
scope: text.crackshell.fnt
7+
variables:
8+
identifier: '[A-Za-z][A-Za-z0-9]*'
9+
number: '-?[0-9]+'
10+
contexts:
11+
preprocessor-expression:
12+
- match: '\b[A-Z0-9_]+\b'
13+
scope: entity.name.constant
14+
- match: '(\|\||&&)'
15+
scope: keyword.operator.logical
16+
- match: '"'
17+
scope: punctuation.definition.string.begin
18+
push:
19+
- meta_scope: string.quoted.double
20+
- match: '"'
21+
scope: punctuation.definition.string.end
22+
pop: true
23+
- match: '$'
24+
pop: true
25+
26+
has-preprocessor:
27+
- match: '^\s*(%)'
28+
captures:
29+
1: keyword.control.import
30+
push:
31+
- meta_scope: meta.preprocessor
32+
- match: '//.*'
33+
scope: comment.line
34+
- match: '(?i)(if|else|endif)\b'
35+
scope: support.function
36+
set: preprocessor-expression
37+
- match: '(PROFILE_START|PROFILE_STOP)\b'
38+
scope: support.function
39+
set:
40+
- meta_scope: string.unquoted
41+
- match: '$'
42+
pop: true
43+
- match: '[A-Za-z_][A-Za-z0-9_]+'
44+
scope: keyword.control.import
45+
set: preprocessor-expression
46+
- match: '$'
47+
pop: true
48+
49+
string:
50+
- meta_scope: string.quoted.double
51+
- match: '"'
52+
scope: punctuation.definition.string.end
53+
pop: true
54+
55+
attribute-value:
56+
- match: '='
57+
scope: keyword.operator.assignment
58+
- match: '{{number}}'
59+
scope: constant.numeric
60+
- match: ','
61+
scope: punctuation.separator
62+
- match: '"'
63+
scope: punctuation.definition.string.begin
64+
push: string
65+
- match: '(?=[^\s]+)'
66+
push:
67+
- meta_scope: string.unquoted
68+
- match: '(?=\s)'
69+
pop: true
70+
- match: ''
71+
pop: true
72+
73+
attribute:
74+
- match: '\b{{identifier}}(?==)\b'
75+
scope: variable.parameter
76+
push: attribute-value
77+
- match: '\b{{identifier}}(?=\s*)\b'
78+
scope: entity.name.function
79+
80+
main:
81+
- include: has-preprocessor
82+
- include: attribute

0 commit comments

Comments
 (0)