Doug Kearns | 68a8947 | 2024-01-05 17:59:04 +0100 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: Modula-2 |
| 3 | " Maintainer: Doug Kearns <dougkearns@gmail.com> |
| 4 | " Last Change: 2024 Jan 04 |
| 5 | |
| 6 | " Dialect can be one of pim, iso, r10 |
| 7 | function modula2#GetDialect() abort |
| 8 | |
| 9 | if exists("b:modula2.dialect") |
| 10 | return b:modula2.dialect |
| 11 | endif |
| 12 | |
| 13 | if exists("g:modula2_default_dialect") |
| 14 | let dialect = g:modula2_default_dialect |
| 15 | else |
| 16 | let dialect = "pim" |
| 17 | endif |
| 18 | |
| 19 | return dialect |
| 20 | endfunction |
| 21 | |
| 22 | function modula2#SetDialect(dialect, extension = "") abort |
| 23 | if exists("b:modula2") |
| 24 | unlockvar! b:modula2 |
| 25 | endif |
| 26 | |
| 27 | let b:modula2 = #{ dialect: a:dialect, extension: a:extension } |
| 28 | lockvar! b:modula2 |
| 29 | endfunction |
| 30 | |
| 31 | " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: |