unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 86bdfa2c8f1578dd98ca1db5f3ce3267d679b115 7421 bytes (raw)
name: test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua 	 # note: path name is non-authoritative(*)

  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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
 
#!/usr/bin/env lua
-- ^ font-lock-comment-face
-- Comment
-- ^ font-lock-comment-face
--[[
Multi-line comment
-- ^ font-lock-comment-face
]]

-- Definition
local function f1() end
--             ^ font-lock-function-name-face
local f2 = function() end
--    ^ font-lock-function-name-face
local tb = { f1 = function() end }
--           ^ font-lock-function-name-face
function tb.f2() end
--          ^ font-lock-function-name-face
function tb:f3() end
--          ^ font-lock-function-name-face
tbl.f4 = function() end
--  ^ font-lock-function-name-face
function x.y:z() end
--           ^ font-lock-function-name-face

-- Keyword
if true then
-- <- font-lock-keyword-face
elseif true then
-- <- font-lock-keyword-face
else end
-- <- font-lock-keyword-face
--   ^ font-lock-keyword-face
local p = {}
-- ^ font-lock-keyword-face
for k,v in pairs({}) do end
-- <- font-lock-keyword-face
--      ^ font-lock-keyword-face
repeat if true then break end until false
-- <- font-lock-keyword-face
--                  ^ font-lock-keyword-face
--                            ^ font-lock-keyword-face
while true do end
-- <- font-lock-keyword-face
--         ^ font-lock-keyword-face
function fn() return true end
-- <- font-lock-keyword-face
--            ^ font-lock-keyword-face
goto label
-- ^ font-lock-keyword-face
::label1::

-- String
local _
_ = "x"
--   ^ font-lock-string-face
_ = 'x'
--   ^ font-lock-string-face
_ = "x\ty"
--   ^ font-lock-string-face
--      ^ font-lock-string-face
_ = "x\"y"
--   ^ font-lock-string-face
--      ^ font-lock-string-face
_ = 'x\'y'
--   ^ font-lock-string-face
--      ^ font-lock-string-face
_ = "x\z
    y"
--  ^ font-lock-string-face
_ = "x\0900y"
--        ^ font-lock-string-face
_ = "x\09y"
--       ^ font-lock-string-face
_ = "x\0y"
--      ^ font-lock-string-face
_ = "x\u{1f602}y"
--             ^ font-lock-string-face
_ = [[x]]
--    ^ font-lock-string-face
_ = [=[x]=]
--     ^ font-lock-string-face

-- Assignment
local n = 0
--    ^ font-lock-variable-name-face
o, p, q = 1, 2, 3
-- <- font-lock-variable-name-face
-- ^ font-lock-variable-name-face
--    ^ font-lock-variable-name-face
tbl[k] = "A"
--  ^ font-lock-variable-name-face
tbl.x = 1
--  ^ font-lock-variable-name-face
for i=0,9 do end
--  ^ font-lock-variable-name-face

-- Constant
local x <const> = 1
--      ^ font-lock-constant-face
local f <close> = io.open('/file')
--      ^ font-lock-constant-face
local a, b, c = true, false, nil
--              ^ font-lock-constant-face
--                    ^ font-lock-constant-face
--                           ^ font-lock-constant-face
::label2::
-- ^ font-lock-constant-face

-- Number
n = 123
--  ^ font-lock-number-face
print(99)
--    ^ font-lock-number-face
tbl[1]
--  ^ font-lock-number-face

-- Bracket
local t = {}
--        ^ font-lock-bracket-face
--         ^ font-lock-bracket-face
print(t[1])
--   ^ font-lock-bracket-face
--     ^ font-lock-bracket-face
--       ^ font-lock-bracket-face
--        ^ font-lock-bracket-face

-- Builtin
assert()
-- <- font-lock-builtin-face
bit32()
-- <- font-lock-builtin-face
collectgarbage()
-- <- font-lock-builtin-face
coroutine()
-- <- font-lock-builtin-face
debug()
-- <- font-lock-builtin-face
dofile()
-- <- font-lock-builtin-face
error()
-- <- font-lock-builtin-face
getmetatable()
-- <- font-lock-builtin-face
io()
-- <- font-lock-builtin-face
ipairs()
-- <- font-lock-builtin-face
load()
-- <- font-lock-builtin-face
loadfile()
-- <- font-lock-builtin-face
math()
-- <- font-lock-builtin-face
next()
-- <- font-lock-builtin-face
os()
-- <- font-lock-builtin-face
package()
-- <- font-lock-builtin-face
pairs()
-- <- font-lock-builtin-face
pcall()
-- <- font-lock-builtin-face
print()
-- <- font-lock-builtin-face
rawequal()
-- <- font-lock-builtin-face
rawget()
-- <- font-lock-builtin-face
rawlen()
-- <- font-lock-builtin-face
rawset()
-- <- font-lock-builtin-face
require()
-- <- font-lock-builtin-face
select()
-- <- font-lock-builtin-face
setmetatable()
-- <- font-lock-builtin-face
string()
-- <- font-lock-builtin-face
table()
-- <- font-lock-builtin-face
tonumber()
-- <- font-lock-builtin-face
tostring()
-- <- font-lock-builtin-face
type()
-- <- font-lock-builtin-face
utf8()
-- <- font-lock-builtin-face
warn()
-- <- font-lock-builtin-face
xpcall()
-- <- font-lock-builtin-face
print(_G)
--    ^ font-lock-builtin-face
print(_VERSION)
--    ^ font-lock-builtin-face
f.close()
-- ^ font-lock-builtin-face
f.flush()
-- ^ font-lock-builtin-face
f.lines()
-- ^ font-lock-builtin-face
f.read()
-- ^ font-lock-builtin-face
f.seek()
-- ^ font-lock-builtin-face
f.setvbuf()
-- ^ font-lock-builtin-face
f.write()
-- ^ font-lock-builtin-face

-- Delimiter
t = { 1, 2 };
--     ^ font-lock-delimiter-face
--          ^ font-lock-delimiter-face

-- Escape
_ = "x\ty"
--    ^ font-lock-escape-face
--     ^ font-lock-escape-face
_ = "x\"y"
--    ^ font-lock-escape-face
--     ^ font-lock-escape-face
_ = 'x\'y'
--    ^ font-lock-escape-face
--     ^ font-lock-escape-face
_ = "x\z
    y"
-- <- font-lock-escape-face
_ = "x\x5Ay"
--     ^ font-lock-escape-face
--      ^ font-lock-escape-face
_ = "x\0900y"
--       ^ font-lock-escape-face
_ = "x\09y"
--      ^ font-lock-escape-face
_ = "x\0y"
--     ^ font-lock-escape-face
_ = "x\u{1f602}y"
--     ^ font-lock-escape-face
--         ^ font-lock-escape-face

-- Function
func_one()
--  ^ font-lock-function-call-face
tbl.func_two()
--  ^ font-lock-function-call-face
tbl:func_three()
--  ^ font-lock-function-call-face
tbl.f = f4()
--      ^ font-lock-function-call-face

-- Operator
local a, b = 1, 2
--         ^ font-lock-operator-face
print(a & b)
--      ^ font-lock-operator-face
print(a | b)
--      ^ font-lock-operator-face
print(a ~ b)
--      ^ font-lock-operator-face
print(a << 1)
--      ^ font-lock-operator-face
--       ^ font-lock-operator-face
print(a >> 1)
--      ^ font-lock-operator-face
--       ^ font-lock-operator-face
print(a and b)
--      ^ font-lock-operator-face
print(a or b)
--      ^ font-lock-operator-face
print(not a)
--      ^ font-lock-operator-face
print(a+b-a*b/a%b^a//b)
--     ^ font-lock-operator-face
--       ^ font-lock-operator-face
--         ^ font-lock-operator-face
--           ^ font-lock-operator-face
--             ^ font-lock-operator-face
--               ^ font-lock-operator-face
--                 ^ font-lock-operator-face
print(#t)
--    ^ font-lock-operator-face
print("h".."at")
--       ^ font-lock-operator-face
print(a==b)
--     ^ font-lock-operator-face
print(a~=b)
--     ^ font-lock-operator-face
print(a<=b)
--     ^ font-lock-operator-face
print(a>=b)
--     ^ font-lock-operator-face
print(a<b)
--     ^ font-lock-operator-face
print(a>b)
--     ^ font-lock-operator-face
function ff(...) end
--          ^ font-lock-operator-face

-- Property
t = { a=1 }
--    ^ font-lock-property-name-face
print(t.a)
--      ^ font-lock-property-use-face

-- Punctuation
tbl.f2()
-- ^ font-lock-punctuation-face
tbl:f3()
-- ^ font-lock-punctuation-face

-- Variable
function fn(x, y) end
--          ^ font-lock-variable-name-face
--             ^ font-lock-variable-name-face
fn(a, b)
-- ^ font-lock-variable-use-face
--    ^ font-lock-variable-use-face
print(a + b)
--    ^ font-lock-variable-use-face
--        ^ font-lock-variable-use-face
print(t[a])
--      ^ font-lock-variable-use-face
tbl.f1(p)
--     ^ font-lock-variable-use-face
tbl:f2(q)
--     ^ font-lock-variable-use-face

debug log:

solving 86bdfa2c8f1 ...
found 86bdfa2c8f1 in https://yhetil.org/emacs-devel/87h6lfqbp9.fsf@thelio.lan/

applying [1/1] https://yhetil.org/emacs-devel/87h6lfqbp9.fsf@thelio.lan/
diff --git a/test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua b/test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua
new file mode 100644
index 00000000000..86bdfa2c8f1

Checking patch test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua...
Applied patch test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua cleanly.

index at:
100644 86bdfa2c8f1578dd98ca1db5f3ce3267d679b115	test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).