-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlan IF Solution.sublime-syntax
61 lines (56 loc) · 2.37 KB
/
Alan IF Solution.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%YAML 1.2
---
# "Alan IF Solution.sublime-syntax" v0.1.0 (2021-06-07) | Alan v3 beta6
# ==============================================================================
# Alan IF Solution Syntax (for Alan IF games' commands scripts)
# ==============================================================================
# Syntax definition for Alan IF Adventures solution files:
# -- https://www.alanif.se
# ------------------------------------------------------------------------------
# Solution files (aka "commands scripts") are used for running an adventure via
# automated player-commands scripts. Alan is now adopting ".a3s" as the official
# file extension for solution files.
# Since this package introduced the ".a3sol" arbitrary extension when there
# wasn't an official one, it will keep using both, at least for a grace period
# of a year or two, because ".a3sol" has been adopted by various projects, and
# we want to allow them time to migrate to the new official extensions -- which
# won't be supported until the next Alan Beta release.
# The need to create a dedicated syntax is mainly due to the fact that Alan
# solution files need to be encoded in ISO-8859-1, therefore Sublime Text must
# be made aware of the extension. But the syntax can also provide some basic
# syntax highlighting, and be associated to a theme, allowing users to customize
# its aesthetics.
# ------------------------------------------------------------------------------
# Copyright (c) Tristano Ajmone, 2018. MIT License.
# -- https://github.com/tajmone/sublime-alan-if
# ------------------------------------------------------------------------------
name: Alan IF Solution
comment: Alan IF Adventure Solution File
file_extensions:
- a3s
- a3sol
scope: source.a3s
contexts:
main:
- include: comments
- include: strings
strings:
- match: '"'
scope: punctuation.definition.string.begin.a3s
push: inside_string
inside_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.a3s
- match: '\.'
scope: constant.character.escape.a3s
- match: '"'
scope: punctuation.definition.string.end.a3s
pop: true
comments:
# Comments begin with a ';' and finish at the end of the line.
- match: ';'
scope: punctuation.definition.comment.a3s
push:
- meta_scope: comment.line.semicolon.a3s
- match: $\n?
pop: true