diff options
| author | john muhl | 2025-03-21 12:15:02 -0500 |
|---|---|---|
| committer | Po Lu | 2025-08-25 09:59:04 +0800 |
| commit | c5656af2ff5f2ee4a683540db792ccece6db4e43 (patch) | |
| tree | dd0eaaab38f36e99b9613854243da73bb5a906bd /test/lisp/progmodes/lua-mode-resources/font-lock.lua | |
| parent | 38a07757425c711e037c526f2c76d342a81e7c17 (diff) | |
| download | emacs-c5656af2ff5f2ee4a683540db792ccece6db4e43.tar.gz emacs-c5656af2ff5f2ee4a683540db792ccece6db4e43.zip | |
; Add tests for 'lua-mode'
* test/lisp/progmodes/lua-mode-resources/font-lock.lua:
* test/lisp/progmodes/lua-mode-resources/hide-show.lua:
* test/lisp/progmodes/lua-mode-resources/indent.erts:
* test/lisp/progmodes/lua-mode-resources/movement.erts:
* test/lisp/progmodes/lua-mode-resources/which-function.lua:
* test/lisp/progmodes/lua-mode-tests.el: New file.
Diffstat (limited to 'test/lisp/progmodes/lua-mode-resources/font-lock.lua')
| -rw-r--r-- | test/lisp/progmodes/lua-mode-resources/font-lock.lua | 184 |
1 files changed, 184 insertions, 0 deletions
diff --git a/test/lisp/progmodes/lua-mode-resources/font-lock.lua b/test/lisp/progmodes/lua-mode-resources/font-lock.lua new file mode 100644 index 00000000000..bcf77b632c2 --- /dev/null +++ b/test/lisp/progmodes/lua-mode-resources/font-lock.lua | |||
| @@ -0,0 +1,184 @@ | |||
| 1 | #!/usr/bin/env lua | ||
| 2 | -- ^ font-lock-comment-face | ||
| 3 | -- Comment | ||
| 4 | -- <- font-lock-comment-delimiter-face | ||
| 5 | -- ^ font-lock-comment-face | ||
| 6 | --[[ | ||
| 7 | -- ^ font-lock-comment-face | ||
| 8 | Multi-line comment | ||
| 9 | -- ^ font-lock-comment-face | ||
| 10 | ]] | ||
| 11 | -- <- font-lock-comment-face | ||
| 12 | local line_comment = "comment" -- comment | ||
| 13 | -- ^ font-lock-comment-face | ||
| 14 | |||
| 15 | -- Definition | ||
| 16 | local function f1() end | ||
| 17 | -- ^ font-lock-function-name-face | ||
| 18 | local f2 = function() end | ||
| 19 | -- ^ font-lock-function-name-face | ||
| 20 | local tb = { f1 = function() end } | ||
| 21 | -- ^ font-lock-function-name-face | ||
| 22 | function tb.f2() end | ||
| 23 | -- ^ font-lock-function-name-face | ||
| 24 | function tb:f3() end | ||
| 25 | -- ^ font-lock-function-name-face | ||
| 26 | tbl.f4 = function() end | ||
| 27 | -- ^ font-lock-function-name-face | ||
| 28 | function x.y:z() end | ||
| 29 | -- ^ font-lock-function-name-face | ||
| 30 | |||
| 31 | -- Keyword | ||
| 32 | if true then | ||
| 33 | -- <- font-lock-keyword-face | ||
| 34 | -- ^ font-lock-keyword-face | ||
| 35 | elseif true then | ||
| 36 | -- <- font-lock-keyword-face | ||
| 37 | else end | ||
| 38 | -- <- font-lock-keyword-face | ||
| 39 | -- ^ font-lock-keyword-face | ||
| 40 | local p = {} | ||
| 41 | -- ^ font-lock-keyword-face | ||
| 42 | for k,v in pairs({}) do end | ||
| 43 | -- <- font-lock-keyword-face | ||
| 44 | -- ^ font-lock-keyword-face | ||
| 45 | repeat if true then break end until false | ||
| 46 | -- <- font-lock-keyword-face | ||
| 47 | -- ^ font-lock-keyword-face | ||
| 48 | -- ^ font-lock-keyword-face | ||
| 49 | while true do end | ||
| 50 | -- <- font-lock-keyword-face | ||
| 51 | -- ^ font-lock-keyword-face | ||
| 52 | function fn() return true end | ||
| 53 | -- <- font-lock-keyword-face | ||
| 54 | -- ^ font-lock-keyword-face | ||
| 55 | goto label1 | ||
| 56 | -- ^ font-lock-keyword-face | ||
| 57 | ::label1:: | ||
| 58 | if true and not false or nil then | ||
| 59 | -- ^ font-lock-keyword-face | ||
| 60 | -- ^ font-lock-keyword-face | ||
| 61 | -- ^ font-lock-keyword-face | ||
| 62 | end | ||
| 63 | |||
| 64 | -- String | ||
| 65 | local _ | ||
| 66 | _ = "x" | ||
| 67 | -- ^ font-lock-string-face | ||
| 68 | _ = 'x' | ||
| 69 | -- ^ font-lock-string-face | ||
| 70 | _ = "x\ty" | ||
| 71 | -- ^ font-lock-string-face | ||
| 72 | -- ^ font-lock-string-face | ||
| 73 | _ = "x\"y" | ||
| 74 | -- ^ font-lock-string-face | ||
| 75 | -- ^ font-lock-string-face | ||
| 76 | _ = 'x\'y' | ||
| 77 | -- ^ font-lock-string-face | ||
| 78 | -- ^ font-lock-string-face | ||
| 79 | _ = "x\z | ||
| 80 | y" | ||
| 81 | -- ^ font-lock-string-face | ||
| 82 | _ = "x\0900y" | ||
| 83 | -- ^ font-lock-string-face | ||
| 84 | _ = "x\09y" | ||
| 85 | -- ^ font-lock-string-face | ||
| 86 | _ = "x\0y" | ||
| 87 | -- ^ font-lock-string-face | ||
| 88 | _ = "x\u{1f602}y" | ||
| 89 | -- ^ font-lock-string-face | ||
| 90 | _ = [[x]] | ||
| 91 | -- ^ font-lock-string-face | ||
| 92 | _ = [=[x]=] | ||
| 93 | -- ^ font-lock-string-face | ||
| 94 | |||
| 95 | -- Assignment | ||
| 96 | local n = 0 | ||
| 97 | -- ^ font-lock-variable-name-face | ||
| 98 | for i=0,9 do end | ||
| 99 | -- ^ font-lock-variable-name-face | ||
| 100 | |||
| 101 | -- Constant | ||
| 102 | ::label2:: | ||
| 103 | -- ^ font-lock-constant-face | ||
| 104 | goto label2 | ||
| 105 | -- ^ font-lock-constant-face | ||
| 106 | |||
| 107 | -- Builtin | ||
| 108 | assert() | ||
| 109 | -- <- font-lock-builtin-face | ||
| 110 | bit32() | ||
| 111 | -- <- font-lock-builtin-face | ||
| 112 | collectgarbage() | ||
| 113 | -- <- font-lock-builtin-face | ||
| 114 | coroutine() | ||
| 115 | -- <- font-lock-builtin-face | ||
| 116 | debug() | ||
| 117 | -- <- font-lock-builtin-face | ||
| 118 | dofile() | ||
| 119 | -- <- font-lock-builtin-face | ||
| 120 | error() | ||
| 121 | -- <- font-lock-builtin-face | ||
| 122 | getmetatable() | ||
| 123 | -- <- font-lock-builtin-face | ||
| 124 | io() | ||
| 125 | -- <- font-lock-builtin-face | ||
| 126 | ipairs() | ||
| 127 | -- <- font-lock-builtin-face | ||
| 128 | load() | ||
| 129 | -- <- font-lock-builtin-face | ||
| 130 | loadfile() | ||
| 131 | -- <- font-lock-builtin-face | ||
| 132 | math() | ||
| 133 | -- <- font-lock-builtin-face | ||
| 134 | next() | ||
| 135 | -- <- font-lock-builtin-face | ||
| 136 | os() | ||
| 137 | -- <- font-lock-builtin-face | ||
| 138 | package() | ||
| 139 | -- <- font-lock-builtin-face | ||
| 140 | pairs() | ||
| 141 | -- <- font-lock-builtin-face | ||
| 142 | pcall() | ||
| 143 | -- <- font-lock-builtin-face | ||
| 144 | print() | ||
| 145 | -- <- font-lock-builtin-face | ||
| 146 | rawequal() | ||
| 147 | -- <- font-lock-builtin-face | ||
| 148 | rawget() | ||
| 149 | -- <- font-lock-builtin-face | ||
| 150 | rawlen() | ||
| 151 | -- <- font-lock-builtin-face | ||
| 152 | rawset() | ||
| 153 | -- <- font-lock-builtin-face | ||
| 154 | require() | ||
| 155 | -- <- font-lock-builtin-face | ||
| 156 | select() | ||
| 157 | -- <- font-lock-builtin-face | ||
| 158 | setmetatable() | ||
| 159 | -- <- font-lock-builtin-face | ||
| 160 | string() | ||
| 161 | -- <- font-lock-builtin-face | ||
| 162 | table() | ||
| 163 | -- <- font-lock-builtin-face | ||
| 164 | tonumber() | ||
| 165 | -- <- font-lock-builtin-face | ||
| 166 | tostring() | ||
| 167 | -- <- font-lock-builtin-face | ||
| 168 | type() | ||
| 169 | -- <- font-lock-builtin-face | ||
| 170 | utf8() | ||
| 171 | -- <- font-lock-builtin-face | ||
| 172 | warn() | ||
| 173 | -- <- font-lock-builtin-face | ||
| 174 | xpcall() | ||
| 175 | -- <- font-lock-builtin-face | ||
| 176 | print(_G) | ||
| 177 | -- ^ font-lock-builtin-face | ||
| 178 | print(_VERSION) | ||
| 179 | -- ^ font-lock-builtin-face | ||
| 180 | |||
| 181 | -- Variable | ||
| 182 | function fn(x, y) end | ||
| 183 | -- ^ font-lock-variable-name-face | ||
| 184 | -- ^ font-lock-variable-name-face | ||