package tm-grammars

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file tm_grammar_fennel.ml

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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
let lang_id = "fennel"
let json = {json|{
  "displayName": "Fennel",
  "name": "fennel",
  "patterns": [
    {
      "include": "#expression"
    }
  ],
  "repository": {
    "comment": {
      "patterns": [
        {
          "begin": ";",
          "end": "$",
          "name": "comment.line.semicolon.fennel"
        }
      ]
    },
    "constants": {
      "patterns": [
        {
          "match": "nil",
          "name": "constant.language.nil.fennel"
        },
        {
          "match": "false|true",
          "name": "constant.language.boolean.fennel"
        },
        {
          "match": "(-?\\d+\\.\\d+([Ee][-+]?\\d+)?)",
          "name": "constant.numeric.double.fennel"
        },
        {
          "match": "(-?\\d+)",
          "name": "constant.numeric.integer.fennel"
        }
      ]
    },
    "expression": {
      "patterns": [
        {
          "include": "#comment"
        },
        {
          "include": "#constants"
        },
        {
          "include": "#sexp"
        },
        {
          "include": "#table"
        },
        {
          "include": "#vector"
        },
        {
          "include": "#keywords"
        },
        {
          "include": "#special"
        },
        {
          "include": "#lua"
        },
        {
          "include": "#strings"
        },
        {
          "include": "#methods"
        },
        {
          "include": "#symbols"
        }
      ]
    },
    "keywords": {
      "match": ":[^ ]+",
      "name": "constant.keyword.fennel"
    },
    "lua": {
      "patterns": [
        {
          "match": "\\b(assert|collectgarbage|dofile|error|getmetatable|ipairs|load|loadfile|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setmetatable|tonumber|tostring|type|xpcall)\\b",
          "name": "support.function.fennel"
        },
        {
          "match": "\\b(coroutine|coroutine.create|coroutine.isyieldable|coroutine.resume|coroutine.running|coroutine.status|coroutine.wrap|coroutine.yield|debug|debug.debug|debug.gethook|debug.getinfo|debug.getlocal|debug.getmetatable|debug.getregistry|debug.getupvalue|debug.getuservalue|debug.sethook|debug.setlocal|debug.setmetatable|debug.setupvalue|debug.setuservalue|debug.traceback|debug.upvalueid|debug.upvaluejoin|io|io.close|io.flush|io.input|io.lines|io.open|io.output|io.popen|io.read|io.stderr|io.stdin|io.stdout|io.tmpfile|io.type|io.write|math|math.abs|math.acos|math.asin|math.atan|math.ceil|math.cos|math.deg|math.exp|math.floor|math.fmod|math.huge|math.log|math.max|math.maxinteger|math.min|math.mininteger|math.modf|math.pi|math.rad|math.random|math.randomseed|math.sin|math.sqrt|math.tan|math.tointeger|math.type|math.ult|os|os.clock|os.date|os.difftime|os.execute|os.exit|os.getenv|os.remove|os.rename|os.setlocale|os.time|os.tmpname|package|package.config|package.cpath|package.loaded|package.loadlib|package.path|package.preload|package.searchers|package.searchpath|string|string.byte|string.char|string.dump|string.find|string.format|string.gmatch|string.gsub|string.len|string.lower|string.match|string.pack|string.packsize|string.rep|string.reverse|string.sub|string.unpack|string.upper|table|table.concat|table.insert|table.move|table.pack|table.remove|table.sort|table.unpack|utf8|utf8.char|utf8.charpattern|utf8.codepoint|utf8.codes|utf8.len|utf8.offset)\\b",
          "name": "support.function.library.fennel"
        },
        {
          "match": "\\b(_(?:G|VERSION))\\b",
          "name": "constant.language.fennel"
        }
      ]
    },
    "methods": {
      "patterns": [
        {
          "match": "\\w+:\\w+",
          "name": "entity.name.function.method.fennel"
        }
      ]
    },
    "sexp": {
      "begin": "\\(",
      "beginCaptures": {
        "0": {
          "name": "punctuation.paren.open.fennel"
        }
      },
      "end": "\\)",
      "endCaptures": {
        "0": {
          "name": "punctuation.paren.close.fennel"
        }
      },
      "name": "sexp.fennel",
      "patterns": [
        {
          "include": "#expression"
        }
      ]
    },
    "special": {
      "patterns": [
        {
          "match": "[#%*+]|\\?\\.|(\\.)?\\.|(/)?/|:|<=?|=|>=?|\\^",
          "name": "keyword.special.fennel"
        },
        {
          "match": "(->(>)?)",
          "name": "keyword.special.fennel"
        },
        {
          "match": "-\\?>(>)?",
          "name": "keyword.special.fennel"
        },
        {
          "match": "-",
          "name": "keyword.special.fennel"
        },
        {
          "match": "not=",
          "name": "keyword.special.fennel"
        },
        {
          "match": "set-forcibly!",
          "name": "keyword.special.fennel"
        },
        {
          "match": "\\b(and|band|bnot|bor|bxor|collect|comment|doc??|doto|each|eval-compiler|for|global|hashfn|icollect|if|import-macros|include|lambda|length|let|local|lshift|lua|macro|macrodebug|macros|match|not=?|or|partial|pick-args|pick-values|quote|require-macros|rshift|set|tset|values|var|when|while|with-open)\\b",
          "name": "keyword.special.fennel"
        },
        {
          "match": "\\b(fn)\\b",
          "name": "keyword.control.fennel"
        },
        {
          "match": "~=",
          "name": "keyword.special.fennel"
        },
        {
          "match": "λ",
          "name": "keyword.special.fennel"
        }
      ]
    },
    "strings": {
      "begin": "\"",
      "end": "\"",
      "name": "string.quoted.double.fennel",
      "patterns": [
        {
          "match": "\\\\.",
          "name": "constant.character.escape.fennel"
        }
      ]
    },
    "symbols": {
      "patterns": [
        {
          "match": "\\w+(?:\\.\\w+)+",
          "name": "entity.name.function.symbol.fennel"
        },
        {
          "match": "\\w+",
          "name": "variable.other.fennel"
        }
      ]
    },
    "table": {
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.table.bracket.open.fennel"
        }
      },
      "end": "}",
      "endCaptures": {
        "0": {
          "name": "punctuation.table.bracket.close.fennel"
        }
      },
      "name": "table.fennel",
      "patterns": [
        {
          "include": "#expression"
        }
      ]
    },
    "vector": {
      "begin": "\\[",
      "beginCaptures": {
        "0": {
          "name": "punctuation.vector.bracket.open.fennel"
        }
      },
      "end": "]",
      "endCaptures": {
        "0": {
          "name": "punctuation.vector.bracket.close.fennel"
        }
      },
      "name": "meta.vector.fennel",
      "patterns": [
        {
          "include": "#expression"
        }
      ]
    }
  },
  "scopeName": "source.fnl"
}|json}