Mercurial > vim
comparison src/testdir/test_filetype.vim @ 34092:ff27442e7851 v9.1.0013
patch 9.1.0013: Modula2 filetype support lacking
Commit: https://github.com/vim/vim/commit/68a89470693c7687d4e736ca056c05de632e3ac7
Author: Doug Kearns <dougkearns@gmail.com>
Date: Fri Jan 5 17:59:04 2024 +0100
patch 9.1.0013: Modula2 filetype support lacking
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: #6796
closes: #8115
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Benjamin Kowarsch <trijezdci@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Jan 2024 18:15:04 +0100 |
parents | a18b8310956a |
children | 1f7df4dae067 |
comparison
equal
deleted
inserted
replaced
34091:27bd5d0816e0 | 34092:ff27442e7851 |
---|---|
451 mib: ['file.mib', 'file.my'], | 451 mib: ['file.mib', 'file.my'], |
452 mix: ['file.mix', 'file.mixal'], | 452 mix: ['file.mix', 'file.mixal'], |
453 mma: ['file.nb'], | 453 mma: ['file.nb'], |
454 mmp: ['file.mmp'], | 454 mmp: ['file.mmp'], |
455 modconf: ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules', '/etc/modprobe.file', 'any/etc/conf.modules', 'any/etc/modprobe.file', 'any/etc/modules', 'any/etc/modules.conf'], | 455 modconf: ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules', '/etc/modprobe.file', 'any/etc/conf.modules', 'any/etc/modprobe.file', 'any/etc/modules', 'any/etc/modules.conf'], |
456 modula2: ['file.m2', 'file.mi'], | |
457 modula3: ['file.m3', 'file.mg', 'file.i3', 'file.ig', 'file.lm3'], | 456 modula3: ['file.m3', 'file.mg', 'file.i3', 'file.ig', 'file.lm3'], |
458 monk: ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'], | 457 monk: ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'], |
459 moo: ['file.moo'], | 458 moo: ['file.moo'], |
460 moonscript: ['file.moon'], | 459 moonscript: ['file.moon'], |
461 move: ['file.move'], | 460 move: ['file.move'], |
1640 | 1639 |
1641 " Modula-2 MODULE not start of line | 1640 " Modula-2 MODULE not start of line |
1642 call writefile(['IMPLEMENTATION MODULE Module2Mod;'], 'modfile.MOD') | 1641 call writefile(['IMPLEMENTATION MODULE Module2Mod;'], 'modfile.MOD') |
1643 split modfile.MOD | 1642 split modfile.MOD |
1644 call assert_equal('modula2', &filetype) | 1643 call assert_equal('modula2', &filetype) |
1644 call assert_equal('pim', b:modula2.dialect) | |
1645 bwipe! | 1645 bwipe! |
1646 | 1646 |
1647 " Modula-2 with comment and empty lines prior MODULE | 1647 " Modula-2 with comment and empty lines prior MODULE |
1648 call writefile(['', '(* with', ' comment *)', '', 'MODULE Module2Mod;'], 'modfile.MOD') | 1648 call writefile(['', '(* with', ' comment *)', '', 'MODULE Module2Mod;'], 'modfile.MOD') |
1649 split modfile.MOD | 1649 split modfile.MOD |
1650 call assert_equal('modula2', &filetype) | 1650 call assert_equal('modula2', &filetype) |
1651 bwipe! | 1651 call assert_equal('pim', b:modula2.dialect) |
1652 bwipe! | |
1653 | |
1652 call delete('modfile.MOD') | 1654 call delete('modfile.MOD') |
1653 | 1655 |
1654 " LambdaProlog module | 1656 " LambdaProlog module |
1655 call writefile(['module lpromod.'], 'modfile.mod') | 1657 call writefile(['module lpromod.'], 'modfile.mod') |
1656 split modfile.mod | 1658 split modfile.mod |
2374 bwipe! | 2376 bwipe! |
2375 | 2377 |
2376 filetype off | 2378 filetype off |
2377 endfunc | 2379 endfunc |
2378 | 2380 |
2381 func Test_def_file() | |
2382 filetype on | |
2383 | |
2384 call writefile(['this is the fallback'], 'Xfile.def', 'D') | |
2385 split Xfile.def | |
2386 call assert_equal('def', &filetype) | |
2387 bwipe! | |
2388 | |
2389 " Test dist#ft#FTdef() | |
2390 | |
2391 let g:filetype_def = 'modula2' | |
2392 split Xfile.def | |
2393 call assert_equal('modula2', &filetype) | |
2394 call assert_equal('pim', b:modula2.dialect) | |
2395 bwipe! | |
2396 unlet g:filetype_def | |
2397 | |
2398 " Modula-2 | |
2399 | |
2400 call writefile(['(* a Modula-2 comment *)'], 'Xfile.def') | |
2401 split Xfile.def | |
2402 call assert_equal('modula2', &filetype) | |
2403 call assert_equal('pim', b:modula2.dialect) | |
2404 bwipe! | |
2405 | |
2406 call writefile(['IMPLEMENTATION MODULE Module2Mod;'], 'Xfile.def') | |
2407 split Xfile.def | |
2408 call assert_equal('modula2', &filetype) | |
2409 call assert_equal('pim', b:modula2.dialect) | |
2410 bwipe! | |
2411 | |
2412 filetype off | |
2413 endfunc | |
2414 | |
2379 " vim: shiftwidth=2 sts=2 expandtab | 2415 " vim: shiftwidth=2 sts=2 expandtab |