diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2024-01-16 17:45:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-16 17:45:57 +0000 |
commit | 91dc04a5e12a3d0c5be56768ded5971bc80e6f8e (patch) | |
tree | 2e9941c656d1ae1e4c4e873632e4c0fbd0c972a1 /runtime/doc | |
parent | fd2ed024c1b0021161bd87af6f7f55e1f6bf4d82 (diff) | |
download | rneovim-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/doc')
-rw-r--r-- | runtime/doc/filetype.txt | 1 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 6c2cddea54..29b929b8a5 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -146,6 +146,7 @@ variables can be used to overrule the filetype used for certain extensions: `*.cls` g:filetype_cls `*.csh` g:filetype_csh |ft-csh-syntax| `*.dat` g:filetype_dat + `*.def` g:filetype_def `*.f` g:filetype_f |ft-forth-syntax| `*.frm` g:filetype_frm |ft-form-syntax| `*.fs` g:filetype_fs |ft-forth-syntax| diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 8cbb958e35..9164171152 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -2206,6 +2206,56 @@ have the following in your vimrc: > let filetype_m = "mma" +MODULA2 *modula2.vim* *ft-modula2-syntax* + +Vim will recognise comments with dialect tags to automatically select a given +dialect. + +The syntax for a dialect tag comment is: > + + taggedComment := + '(*!' dialectTag '*)' + ; + + dialectTag := + m2pim | m2iso | m2r10 + ; + + reserved words + m2pim = 'm2pim', m2iso = 'm2iso', m2r10 = 'm2r10' + +A dialect tag comment is recognised by Vim if it occurs within the first 200 +lines of the source file. Only the very first such comment is recognised, any +additional dialect tag comments are ignored. + +Example: > + + DEFINITION MODULE FooLib; (*!m2pim*) + ... + +Variable g:modula2_default_dialect sets the default Modula-2 dialect when the +dialect cannot be determined from the contents of the Modula-2 file: if +defined and set to 'm2pim', the default dialect is PIM. + +Example: > + + let g:modula2_default_dialect = 'm2pim' + + +Highlighting is further configurable for each dialect via the following +variables. + +Variable Highlight ~ +*modula2_iso_allow_lowline* allow low line in identifiers +*modula2_iso_disallow_octals* disallow octal integer literals +*modula2_iso_disallow_synonyms* disallow "@", "&" and "~" synonyms + +*modula2_pim_allow_lowline* allow low line in identifiers +*modula2_pim_disallow_octals* disallow octal integer literals +*modula2_pim_disallow_synonyms* disallow "&" and "~" synonyms + +*modula2_r10_allow_lowline* allow low line in identifiers + MOO *moo.vim* *ft-moo-syntax* If you use C-style comments inside expressions and find it mangles your |