diff options
| author | orbitalquark <70453897+orbitalquark@users.noreply.github.com> | 2024-09-18 14:42:10 -0400 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2025-01-04 12:32:42 -0700 |
| commit | e54caf087cecda02b625b5d5d51c667746002a3e (patch) | |
| tree | cd2b87153910798247aa7611b7a6e4f926082b55 /lua | |
| parent | c1f4d3f68787fa2ae964c468d28a84df37319b28 (diff) | |
| download | vis-e54caf087cecda02b625b5d5d51c667746002a3e.tar.gz vis-e54caf087cecda02b625b5d5d51c667746002a3e.tar.xz | |
Rename 'ansi_c', 'dmd', and 'rstats' lexers to 'c', 'd', and 'r'
Originally this was to prevent clashes with Textadept's language-specific key handling, but this is
no longer applicable.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lexers/c.lua (renamed from lua/lexers/ansi_c.lua) | 0 | ||||
| -rw-r--r-- | lua/lexers/d.lua (renamed from lua/lexers/dmd.lua) | 0 | ||||
| -rw-r--r-- | lua/lexers/glsl.lua | 2 | ||||
| -rw-r--r-- | lua/lexers/lexer.lua | 12 | ||||
| -rw-r--r-- | lua/lexers/output.lua | 2 | ||||
| -rw-r--r-- | lua/lexers/r.lua (renamed from lua/lexers/rstats.lua) | 2 |
6 files changed, 7 insertions, 11 deletions
diff --git a/lua/lexers/ansi_c.lua b/lua/lexers/c.lua index eacae09..eacae09 100644 --- a/lua/lexers/ansi_c.lua +++ b/lua/lexers/c.lua diff --git a/lua/lexers/dmd.lua b/lua/lexers/d.lua index 32609cc..32609cc 100644 --- a/lua/lexers/dmd.lua +++ b/lua/lexers/d.lua diff --git a/lua/lexers/glsl.lua b/lua/lexers/glsl.lua index 878ca96..3999a1a 100644 --- a/lua/lexers/glsl.lua +++ b/lua/lexers/glsl.lua @@ -4,7 +4,7 @@ local lexer = lexer local P, S = lpeg.P, lpeg.S -local lex = lexer.new(..., {inherit = lexer.load('ansi_c')}) +local lex = lexer.new(..., {inherit = lexer.load('c')}) -- Word lists. lex:set_word_list(lexer.KEYWORD, { diff --git a/lua/lexers/lexer.lua b/lua/lexers/lexer.lua index 2ea6492..0faeae9 100644 --- a/lua/lexers/lexer.lua +++ b/lua/lexers/lexer.lua @@ -50,9 +50,6 @@ -- lexer should be the name of your programming language in lower case followed by a *.lua* -- extension. For example, a new Lua lexer has the name *lua.lua*. -- --- Note: Try to refrain from using one-character language names like "c", "d", or "r". For --- example, Scintillua uses "ansi_c", "dmd", and "rstats", respectively. --- -- #### New Lexer Template -- -- There is a *lexers/template.txt* file that contains a simple template for a new lexer. Feel @@ -1612,8 +1609,8 @@ function M.detect(filename, line) bib = 'bibtex', -- boo = 'boo', -- cs = 'csharp', -- - c = 'ansi_c', C = 'ansi_c', cc = 'cpp', cpp = 'cpp', cxx = 'cpp', ['c++'] = 'cpp', h = 'cpp', - hh = 'cpp', hpp = 'cpp', hxx = 'cpp', ['h++'] = 'cpp', -- + c = 'c', C = 'c', cc = 'cpp', cpp = 'cpp', cxx = 'cpp', ['c++'] = 'cpp', h = 'cpp', hh = 'cpp', + hpp = 'cpp', hxx = 'cpp', ['h++'] = 'cpp', -- ck = 'chuck', -- clj = 'clojure', cljs = 'clojure', cljc = 'clojure', edn = 'clojure', -- ['CMakeLists.txt'] = 'cmake', cmake = 'cmake', ['cmake.in'] = 'cmake', ctest = 'cmake', @@ -1622,7 +1619,7 @@ function M.detect(filename, line) cr = 'crystal', -- css = 'css', -- cu = 'cuda', cuh = 'cuda', -- - d = 'dmd', di = 'dmd', -- + d = 'd', di = 'd', -- dart = 'dart', -- desktop = 'desktop', -- diff = 'diff', patch = 'diff', -- @@ -1700,8 +1697,7 @@ function M.detect(filename, line) proto = 'protobuf', -- pure = 'pure', -- sc = 'python', py = 'python', pyw = 'python', -- - R = 'rstats', Rout = 'rstats', Rhistory = 'rstats', Rt = 'rstats', ['Rout.save'] = 'rstats', - ['Rout.fail'] = 'rstats', -- + R = 'r', Rout = 'r', Rhistory = 'r', Rt = 'r', ['Rout.save'] = 'r', ['Rout.fail'] = 'r', -- re = 'reason', -- r = 'rebol', reb = 'rebol', -- rst = 'rest', -- diff --git a/lua/lexers/output.lua b/lua/lexers/output.lua index 9408ab1..58b25c5 100644 --- a/lua/lexers/output.lua +++ b/lua/lexers/output.lua @@ -66,7 +66,7 @@ lex:add_rule('python', local lparen, rparen = text('('), text(')') local d_filename = filename((lexer.nonnewline - '(')^1) local d_error = message(lexer.to_eol(S('Ee') * 'rror')) * mark_error -lex:add_rule('dmd', starts_line(d_filename) * lparen * line * rparen * colon * d_error) +lex:add_rule('d', starts_line(d_filename) * lparen * line * rparen * colon * d_error) -- "filename" line X: message (gnuplot) local gp_filename = filename((lexer.nonnewline - '"')^1) diff --git a/lua/lexers/rstats.lua b/lua/lexers/r.lua index 9883297..7ac801e 100644 --- a/lua/lexers/rstats.lua +++ b/lua/lexers/r.lua @@ -5,7 +5,7 @@ local lexer = require('lexer') local token, word_match = lexer.token, lexer.word_match local P, S = lpeg.P, lpeg.S -local lex = lexer.new('rstats') +local lex = lexer.new('r') -- Whitespace. lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1)) |
