aboutsummaryrefslogtreecommitdiff
path: root/runtime/compiler
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2024-01-16 17:45:57 +0000
committerGitHub <noreply@github.com>2024-01-16 17:45:57 +0000
commit91dc04a5e12a3d0c5be56768ded5971bc80e6f8e (patch)
tree2e9941c656d1ae1e4c4e873632e4c0fbd0c972a1 /runtime/compiler
parentfd2ed024c1b0021161bd87af6f7f55e1f6bf4d82 (diff)
downloadrneovim-91dc04a5e12a3d0c5be56768ded5971bc80e6f8e.tar.gz
rneovim-91dc04a5e12a3d0c5be56768ded5971bc80e6f8e.tar.bz2
rneovim-91dc04a5e12a3d0c5be56768ded5971bc80e6f8e.zip
vim-patch:9.1.0013: Modula2 filetype support lacking (#27020)
Problem: Modula2 filetype support lacking Solution: Improve the Modula-2 runtime support, add additional modula2 dialects, add compiler plugin, update syntax highlighting, include syntax tests, update Makefiles (Doug Kearns) closes: vim/vim#6796 closes: vim/vim#8115 https://github.com/vim/vim/commit/68a89470693c7687d4e736ca056c05de632e3ac7 - Luaify the detection script: - Split the `(*!m2foo*)` and `(*!m2foo+bar*)` detection into two Lua patterns, as Lua capture groups cannot be used with `?` and friends (as they only work on character classes). - Use `vim.api.nvim_buf_call()` (ew) to call `modula2#SetDialect()` to ensure `b:modula2` is set for the given bufnr. - Skip the syntax screendump tests. (A shame as they test some of the detection from `(*!m2foo+bar*)` tags, but I tested this locally and it seems to work) - Port the synmenu.vim changes from Vim9 script. (Also tested this locally) - (And also add the missing comma for `b:browsefilter` from earlier.) Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat (limited to 'runtime/compiler')
-rw-r--r--runtime/compiler/gm2.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/runtime/compiler/gm2.vim b/runtime/compiler/gm2.vim
new file mode 100644
index 0000000000..5053912200
--- /dev/null
+++ b/runtime/compiler/gm2.vim
@@ -0,0 +1,26 @@
+" Vim compiler file
+" Compiler: GNU Modula-2 Compiler
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2024 Jan 04
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "gm2"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=gm2
+CompilerSet errorformat=%-G%f:%l:%c:\ error:\ compilation\ failed,
+ \%f:%l:%c:\ %trror:\ %m,
+ \%f:%l:%c:\ %tarning:\ %m,
+ \%f:%l:%c:\ %tote:\ %m,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save