-
Notifications
You must be signed in to change notification settings - Fork 0
/
faust.sublime-syntax
90 lines (76 loc) · 2.59 KB
/
faust.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: faust
file_extensions:
- dsp
- lib
scope: source.faust
contexts:
# The prototype context is prepended to all contexts but those setting
# meta_include_prototype: false.
prototype:
- include: comments
main:
# The main context is the initial starting point of our syntax.
# Include other contexts from here (or specify them directly).
- include: keywords
- include: numbers
- include: strings
- include: operators
- include: imports
- include: variables
- include: constants
- include: primitives
- include: gui
keywords:
# Note that blackslashes don't need to be escaped within single quoted
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
- match: '\b(float|int)\b'
scope: keyword.control.faust
primitives:
- match: '\b(mem|prefix|int|float|rdtable|rwtable|select2|select3|ffunction|fconstant|fvariable|acos|asin|atan|atan2|cos|sin|tan|exp|log|log10|pow|sqrt|abs|fabsf|min|max|fmod|remainder|floor|ceil|rint)\b'
scope: variable.language.faust
gui:
- match: '\b(button|checkbox|vslider|hslider|nentry|vgroup|hgroup|tgroup|vbargraph|hbargraph|attach)\b'
scope: variable.language.faust
imports:
- match: '\b(import|declare|library|component|environment)\b'
scope: keyword.import.faust
variables:
- match: '\b(process)\b'
scope: variable.language.faust
constants:
- match: '\b[A-Z_]*\b'
scope: constant.language.faust
operators:
- match: '\b(with|letrec|case|seq|par|sum|prod|~|:|!|%|&|\*|\-|\+|==|=|!=|!=|<=|<!|>=|<|>|!|&&|\|\|)\b'
scope: keyword.operator.faust
numbers:
- match: '\b(-)?[0-9.]+\b'
scope: constant.numeric.faust
strings:
# Strings begin and end with quotes, and use backslashes as an escape
# character.
- match: '"'
scope: punctuation.definition.string.begin.faust
push: inside_string
inside_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.faust
- match: '\.'
scope: constant.character.escape.faust
- match: '"'
scope: punctuation.definition.string.end.faust
pop: true
comments:
# Comments begin with a '//' and finish at the end of the line.
- match: '//'
scope: punctuation.definition.comment.faust
push:
# This is an anonymous context push for brevity.
- meta_scope: comment.line.double-slash.faust
- match: $\n?
pop: true