codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Modula-33" Maintainer: Doug Kearns <dougkearns@gmail.com>4" Previous Maintainer: Timo Pedersen <dat97tpe@ludat.lth.se>5" Last Change: 2022 Oct 316 7if exists("b:current_syntax")8 finish9endif10 11" Whitespace errors {{{112if exists("modula3_space_errors")13 if !exists("modula3_no_trail_space_error")14 syn match modula3SpaceError display excludenl "\s\+$"15 endif16 if !exists("modula3_no_tab_space_error")17 syn match modula3SpaceError display " \+\t"me=e-118 endif19endif20 21" Keywords {{{122syn keyword modula3Keyword ANY ARRAY AS BITS BRANDED BY CASE CONST23syn keyword modula3Keyword DEFINITION EVAL EXIT EXCEPT EXCEPTION EXIT24syn keyword modula3Keyword EXPORTS FINALLY FROM GENERIC IMPORT LOCK METHOD25syn keyword modula3Keyword OF RAISE RAISES READONLY RECORD REF26syn keyword modula3Keyword RETURN SET TRY TYPE TYPECASE UNSAFE 27syn keyword modula3Keyword VALUE VAR WITH28 29syn match modula3keyword "\<UNTRACED\>"30 31" Special keywords, block delimiters etc32syn keyword modula3Block PROCEDURE FUNCTION MODULE INTERFACE REPEAT THEN33syn keyword modula3Block BEGIN END OBJECT METHODS OVERRIDES RECORD REVEAL34syn keyword modula3Block WHILE UNTIL DO TO IF FOR ELSIF ELSE LOOP35 36" Reserved identifiers {{{137syn keyword modula3Identifier ABS ADR ADRSIZE BITSIZE BYTESIZE CEILING DEC38syn keyword modula3Identifier DISPOSE FIRST FLOAT FLOOR INC ISTYPE LAST39syn keyword modula3Identifier LOOPHOLE MAX MIN NARROW NEW NUMBER ORD ROUND40syn keyword modula3Identifier SUBARRAY TRUNC TYPECODE VAL41 42" Predefined types {{{143syn keyword modula3Type ADDRESS BOOLEAN CARDINAL CHAR EXTENDED INTEGER44syn keyword modula3Type LONGCARD LONGINT LONGREAL MUTEX NULL REAL REFANY TEXT45syn keyword modula3Type WIDECHAR46 47syn match modula3Type "\<\%(UNTRACED\s\+\)\=ROOT\>"48 49" Operators {{{150syn keyword modula3Operator DIV MOD51syn keyword modula3Operator IN52syn keyword modula3Operator NOT AND OR53 54" TODO: exclude = from declarations55if exists("modula3_operators")56 syn match modula3Operator "\^"57 syn match modula3Operator "[-+/*]"58 syn match modula3Operator "&"59 syn match modula3Operator "<=\|<:\@!\|>=\|>"60 syn match modula3Operator ":\@<!=\|#"61endif62 63" Literals {{{164 65" Booleans66syn keyword modula3Boolean TRUE FALSE67 68" Nil69syn keyword modula3Nil NIL70 71" Numbers {{{272 73" NOTE: Negated numbers are constant expressions not literals74 75syn case ignore76 77 " Integers78 79 syn match modula3Integer "\<\d\+L\=\>"80 81 if exists("modula3_number_errors")82 syn match modula3IntegerError "\<\d\d\=_\x\+L\=\>"83 endif84 85 let s:digits = "0123456789ABCDEF"86 for s:radix in range(2, 16)87 exe $'syn match modula3Integer "\<{s:radix}_[{s:digits[:s:radix - 1]}]\+L\=\>"'88 endfor89 unlet s:digits s:radix90 91 " Reals92 syn match modula3Real "\<\d\+\.\d\+\%([EDX][+-]\=\d\+\)\=\>"93 94syn case match95 96" Strings and characters {{{297 98" String escape sequences99syn match modula3Escape "\\['"ntrf]" contained display100" TODO: limit to <= 377 (255)101syn match modula3Escape "\\\o\{3}" contained display102syn match modula3Escape "\\\\" contained display103 104" Characters105syn match modula3Character "'\%([^']\|\\.\|\\\o\{3}\)'" contains=modula3Escape106 107" Strings108syn region modula3String start=+"+ end=+"+ contains=modula3Escape109 110" Pragmas {{{1111" EXTERNAL INLINE ASSERT TRACE FATAL UNUSED OBSOLETE CALLBACK EXPORTED PRAGMA NOWARN LINE LL LL.sup SPEC112" Documented: INLINE ASSERT TRACE FATAL UNUSED OBSOLETE NOWARN113syn region modula3Pragma start="<\*" end="\*>"114 115" Comments {{{1116if !exists("modula3_no_comment_fold")117 syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell fold118 syn region modula3LineCommentBlock start="^\s*(\*.*\*)\s*\n\%(^\s*(\*.*\*)\s*$\)\@=" end="^\s*(\*.*\*)\s*\n\%(^\s*(\*.*\*)\s*$\)\@!" contains=modula3Comment transparent fold keepend119else120 syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell121endif122 123" Syncing "{{{1124syn sync minlines=100125 126" Default highlighting {{{1127hi def link modula3Block Statement128hi def link modula3Boolean Boolean129hi def link modula3Character Character130hi def link modula3Comment Comment131hi def link modula3Escape Special132hi def link modula3Identifier Keyword133hi def link modula3Integer Number134hi def link modula3Keyword Statement135hi def link modula3Nil Constant136hi def link modula3IntegerError Error137hi def link modula3Operator Operator138hi def link modula3Pragma PreProc139hi def link modula3Real Float140hi def link modula3String String141hi def link modula3Type Type "}}}142 143let b:current_syntax = "modula3"144 145" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:146 