71 changes: 7 additions & 64 deletions runtime/syntax/modula2.vim
@@ -1,73 +1,16 @@
" Vim syntax file
" Language: Modula 2
" Maintainer: pf@artcom0.north.de (Peter Funk)
" based on original work of Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 May 09
" Language: Modula-2
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: pf@artcom0.north.de (Peter Funk)
" Last Change: 2022 Oct 18

" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif

" Don't ignore case (Modula-2 is case significant). This is the default in vim

" Especially emphasize headers of procedures and modules:
syn region modula2Header matchgroup=modula2Header start="PROCEDURE " end="(" contains=modula2Ident oneline
syn region modula2Header matchgroup=modula2Header start="MODULE " end=";" contains=modula2Ident oneline
syn region modula2Header matchgroup=modula2Header start="BEGIN (\*" end="\*)" contains=modula2Ident oneline
syn region modula2Header matchgroup=modula2Header start="END " end=";" contains=modula2Ident oneline
syn region modula2Keyword start="END" end=";" contains=ALLBUT,modula2Ident oneline

" Some very important keywords which should be emphasized more than others:
syn keyword modula2AttKeyword CONST EXIT HALT RETURN TYPE VAR
" All other keywords in alphabetical order:
syn keyword modula2Keyword AND ARRAY BY CASE DEFINITION DIV DO ELSE
syn keyword modula2Keyword ELSIF EXPORT FOR FROM IF IMPLEMENTATION IMPORT
syn keyword modula2Keyword IN LOOP MOD NOT OF OR POINTER QUALIFIED RECORD
syn keyword modula2Keyword SET THEN TO UNTIL WHILE WITH

syn keyword modula2Type ADDRESS BITSET BOOLEAN CARDINAL CHAR INTEGER REAL WORD
syn keyword modula2StdFunc ABS CAP CHR DEC EXCL INC INCL ORD SIZE TSIZE VAL
syn keyword modula2StdConst FALSE NIL TRUE
" The following may be discussed, since NEW and DISPOSE are some kind of
" special builtin macro functions:
syn keyword modula2StdFunc NEW DISPOSE
" The following types are added later on and may be missing from older
" Modula-2 Compilers (they are at least missing from the original report
" by N.Wirth from March 1980 ;-) Highlighting should apply nevertheless:
syn keyword modula2Type BYTE LONGCARD LONGINT LONGREAL PROC SHORTCARD SHORTINT
" same note applies to min and max, which were also added later to m2:
syn keyword modula2StdFunc MAX MIN
" The underscore was originally disallowed in m2 ids, it was also added later:
syn match modula2Ident " [A-Z,a-z][A-Z,a-z,0-9,_]*" contained

" Comments may be nested in Modula-2:
syn region modula2Comment start="(\*" end="\*)" contains=modula2Comment,modula2Todo
syn keyword modula2Todo contained TODO FIXME XXX

" Strings
syn region modula2String start=+"+ end=+"+
syn region modula2String start="'" end="'"
syn region modula2Set start="{" end="}"

" Define the default highlighting.
" Only when an item doesn't have highlighting yet

hi def link modula2Ident Identifier
hi def link modula2StdConst Boolean
hi def link modula2Type Identifier
hi def link modula2StdFunc Identifier
hi def link modula2Header Type
hi def link modula2Keyword Statement
hi def link modula2AttKeyword PreProc
hi def link modula2Comment Comment
" The following is just a matter of taste (you want to try this instead):
" hi modula2Comment term=bold ctermfg=DarkBlue guifg=Blue gui=bold
hi def link modula2Todo Todo
hi def link modula2String String
hi def link modula2Set String

let dialect = modula2#GetDialect()
exe "runtime! syntax/modula2/opt/" .. dialect .. ".vim"

let b:current_syntax = "modula2"

" vim: ts=8
" vim: nowrap sw=2 sts=2 ts=8 noet:
381 changes: 381 additions & 0 deletions runtime/syntax/modula2/opt/iso.vim
@@ -0,0 +1,381 @@
" Vim syntax file
" Language: Modula-2 (ISO)
" Maintainer: B.Kowarsch <trijezdci@moc.liamg>
" Last Change: 2016 August 22

" ----------------------------------------------------
" THIS FILE IS LICENSED UNDER THE VIM LICENSE
" see https://github.com/vim/vim/blob/master/LICENSE
" ----------------------------------------------------

" Remarks:
" Vim Syntax files are available for the following Modula-2 dialects:
" * for the PIM dialect : m2pim.vim
" * for the ISO dialect : m2iso.vim (this file)
" * for the R10 dialect : m2r10.vim

" -----------------------------------------------------------------------------
" This syntax description follows ISO standard IS-10514 (aka ISO Modula-2)
" with the addition of the following language extensions:
" * non-standard types LONGCARD and LONGBITSET
" * non-nesting code disabling tags ?< and >? at the start of a line
" -----------------------------------------------------------------------------

" Parameters:
"
" Vim's filetype script recognises Modula-2 dialect tags within the first 100
" lines of Modula-2 .def and .mod input files. The script sets filetype and
" dialect automatically when a valid dialect tag is found in the input file.
" The dialect tag for the ISO dialect is (*!m2iso*). It is recommended to put
" the tag immediately after the module header in the Modula-2 input file.
"
" Example:
" DEFINITION MODULE Foolib; (*!m2iso*)
"
" Variable g:modula2_default_dialect sets the default Modula-2 dialect when the
" dialect cannot be determined from the contents of the Modula-2 input file:
" if defined and set to 'm2iso', the default dialect is ISO.
"
" Variable g:modula2_iso_allow_lowline controls support for lowline in identifiers:
" if defined and set to a non-zero value, they are recognised, otherwise not
"
" Variable g:modula2_iso_disallow_octals controls the rendering of octal literals:
" if defined and set to a non-zero value, they are rendered as errors.
"
" Variable g:modula2_iso_disallow_synonyms controls the rendering of @, & and ~:
" if defined and set to a non-zero value, they are rendered as errors.
"
" Variables may be defined in Vim startup file .vimrc
"
" Examples:
" let g:modula2_default_dialect = 'm2iso'
" let g:modula2_iso_allow_lowline = 1
" let g:modula2_iso_disallow_octals = 1
" let g:modula2_iso_disallow_synonyms = 1


if exists("b:current_syntax")
finish
endif

" Modula-2 is case sensitive
syn case match


" -----------------------------------------------------------------------------
" Reserved Words
" -----------------------------------------------------------------------------
syn keyword modula2Resword AND ARRAY BEGIN BY CASE CONST DEFINITION DIV DO ELSE
syn keyword modula2Resword ELSIF EXCEPT EXIT EXPORT FINALLY FOR FORWARD FROM IF
syn keyword modula2Resword IMPLEMENTATION IMPORT IN LOOP MOD NOT OF OR PACKEDSET
syn keyword modula2Resword POINTER QUALIFIED RECORD REPEAT REM RETRY RETURN SET
syn keyword modula2Resword THEN TO TYPE UNTIL VAR WHILE WITH


" -----------------------------------------------------------------------------
" Builtin Constant Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2ConstIdent FALSE NIL TRUE INTERRUPTIBLE UNINTERRUPTIBLE


" -----------------------------------------------------------------------------
" Builtin Type Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2TypeIdent BITSET BOOLEAN CHAR PROC
syn keyword modula2TypeIdent CARDINAL INTEGER LONGINT REAL LONGREAL
syn keyword modula2TypeIdent COMPLEX LONGCOMPLEX PROTECTION


" -----------------------------------------------------------------------------
" Builtin Procedure and Function Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2ProcIdent CAP DEC EXCL HALT INC INCL
syn keyword modula2FuncIdent ABS CHR CMPLX FLOAT HIGH IM INT LENGTH LFLOAT MAX MIN
syn keyword modula2FuncIdent ODD ORD RE SIZE TRUNC VAL


" -----------------------------------------------------------------------------
" Wirthian Macro Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2MacroIdent NEW DISPOSE


" -----------------------------------------------------------------------------
" Unsafe Facilities via Pseudo-Module SYSTEM
" -----------------------------------------------------------------------------
syn keyword modula2UnsafeIdent ADDRESS BYTE LOC WORD
syn keyword modula2UnsafeIdent ADR CAST TSIZE SYSTEM
syn keyword modula2UnsafeIdent MAKEADR ADDADR SUBADR DIFADR ROTATE SHIFT


" -----------------------------------------------------------------------------
" Non-Portable Language Extensions
" -----------------------------------------------------------------------------
syn keyword modula2NonPortableIdent LONGCARD LONGBITSET


" -----------------------------------------------------------------------------
" User Defined Identifiers
" -----------------------------------------------------------------------------
syn match modula2Ident "[a-zA-Z][a-zA-Z0-9]*\(_\)\@!"
syn match modula2LowLineIdent "[a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)\+"


" -----------------------------------------------------------------------------
" String Literals
" -----------------------------------------------------------------------------
syn region modula2String start=/"/ end=/"/ oneline
syn region modula2String start=/'/ end=/'/ oneline


" -----------------------------------------------------------------------------
" Numeric Literals
" -----------------------------------------------------------------------------
syn match modula2Num
\ "\(\([0-7]\+\)[BC]\@!\|[89]\)[0-9]*\(\.[0-9]\+\([eE][+-]\?[0-9]\+\)\?\)\?"
syn match modula2Num "[0-9A-F]\+H"
syn match modula2Octal "[0-7]\+[BC]"


" -----------------------------------------------------------------------------
" Punctuation
" -----------------------------------------------------------------------------
syn match modula2Punctuation
\ "\.\|[,:;]\|\*\|[/+-]\|\#\|[=<>]\|\^\|\[\|\]\|(\(\*\)\@!\|[){}]"
syn match modula2Synonym "[@&~]"


" -----------------------------------------------------------------------------
" Pragmas
" -----------------------------------------------------------------------------
syn region modula2Pragma start="<\*" end="\*>"
syn match modula2DialectTag "(\*!m2iso\(+[a-z0-9]\+\)\?\*)"

" -----------------------------------------------------------------------------
" Block Comments
" -----------------------------------------------------------------------------
syn region modula2Comment start="(\*\(!m2iso\(+[a-z0-9]\+\)\?\*)\)\@!" end="\*)"
\ contains = modula2Comment, modula2CommentKey, modula2TechDebtMarker
syn match modula2CommentKey "[Aa]uthor[s]\?\|[Cc]opyright\|[Ll]icense\|[Ss]ynopsis"
syn match modula2CommentKey "\([Pp]re\|[Pp]ost\|[Ee]rror\)\-condition[s]\?:"


" -----------------------------------------------------------------------------
" Technical Debt Markers
" -----------------------------------------------------------------------------
syn keyword modula2TechDebtMarker contained DEPRECATED FIXME
syn match modula2TechDebtMarker "TODO[:]\?" contained


" -----------------------------------------------------------------------------
" Disabled Code Sections
" -----------------------------------------------------------------------------
syn region modula2DisabledCode start="^?<" end="^>?"


" -----------------------------------------------------------------------------
" Headers
" -----------------------------------------------------------------------------
" !!! this section must be second last !!!

" new module header
syn match modula2ModuleHeader
\ "MODULE\( [A-Z][a-zA-Z0-9]*\)\?"
\ contains = modula2ReswordModule, modula2ModuleIdent

syn match modula2ModuleIdent
\ "[A-Z][a-zA-Z0-9]*" contained

syn match modula2ModuleTail
\ "END [A-Z][a-zA-Z0-9]*\.$"
\ contains = modula2ReswordEnd, modula2ModuleIdent, modula2Punctuation

" new procedure header
syn match modula2ProcedureHeader
\ "PROCEDURE\( [a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)*\)\?"
\ contains = modula2ReswordProcedure,
\ modula2ProcedureIdent, modula2ProcedureLowlineIdent, modula2IllegalChar, modula2IllegalIdent

syn match modula2ProcedureIdent
\ "\([a-zA-Z]\)\([a-zA-Z0-9]*\)" contained

syn match modula2ProcedureLowlineIdent
\ "[a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)\+" contained

syn match modula2ProcedureTail
\ "END\( \([a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)*\)[.;]$\)\?"
\ contains = modula2ReswordEnd,
\ modula2ProcedureIdent, modula2ProcedureLowLineIdent,
\ modula2Punctuation, modula2IllegalChar, modula2IllegalIdent

syn keyword modula2ReswordModule contained MODULE
syn keyword modula2ReswordProcedure contained PROCEDURE
syn keyword modula2ReswordEnd contained END


" -----------------------------------------------------------------------------
" Illegal Symbols
" -----------------------------------------------------------------------------
" !!! this section must be last !!!

" any '`' '!' '$' '%' or '\'
syn match modula2IllegalChar "[`!$%\\]"

" any solitary sequence of '_'
syn match modula2IllegalChar "\<_\+\>"

" any '?' at start of line if not followed by '<'
syn match modula2IllegalChar "^?\(<\)\@!"

" any '?' not following '>' at start of line
syn match modula2IllegalChar "\(\(^>\)\|\(^\)\)\@<!?"

" any identifiers with leading occurrences of '_'
syn match modula2IllegalIdent "_\+[a-zA-Z][a-zA-Z0-9]*\(_\+[a-zA-Z0-9]*\)*"

" any identifiers containing consecutive occurences of '_'
syn match modula2IllegalIdent
\ "[a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)*\(__\+[a-zA-Z0-9]\+\(_[a-zA-Z0-9]\+\)*\)\+"

" any identifiers with trailing occurrences of '_'
syn match modula2IllegalIdent "[a-zA-Z][a-zA-Z0-9]*\(_\+[a-zA-Z0-9]\+\)*_\+\>"


" -----------------------------------------------------------------------------
" Define Rendering Styles
" -----------------------------------------------------------------------------

" highlight default link modula2PredefIdentStyle Keyword
" highlight default link modula2ConstIdentStyle modula2PredefIdentStyle
" highlight default link modula2TypeIdentStyle modula2PredefIdentStyle
" highlight default link modula2ProcIdentStyle modula2PredefIdentStyle
" highlight default link modula2FuncIdentStyle modula2PredefIdentStyle
" highlight default link modula2MacroIdentStyle modula2PredefIdentStyle

highlight default link modula2ConstIdentStyle Constant
highlight default link modula2TypeIdentStyle Type
highlight default link modula2ProcIdentStyle Function
highlight default link modula2FuncIdentStyle Function
highlight default link modula2MacroIdentStyle Function
highlight default link modula2UnsafeIdentStyle Question
highlight default link modula2NonPortableIdentStyle Question
highlight default link modula2StringLiteralStyle String
highlight default link modula2CommentStyle Comment
highlight default link modula2PragmaStyle PreProc
highlight default link modula2DialectTagStyle SpecialComment
highlight default link modula2TechDebtMarkerStyle SpecialComment
highlight default link modula2ReswordStyle Keyword
highlight default link modula2HeaderIdentStyle Function
highlight default link modula2UserDefIdentStyle Normal
highlight default link modula2NumericLiteralStyle Number
highlight default link modula2PunctuationStyle Delimiter
highlight default link modula2CommentKeyStyle SpecialComment
highlight default link modula2DisabledCodeStyle NonText

" -----------------------------------------------------------------------------
" Assign Rendering Styles
" -----------------------------------------------------------------------------

" headers
highlight default link modula2ModuleIdent modula2HeaderIdentStyle
highlight default link modula2ProcedureIdent modula2HeaderIdentStyle
highlight default link modula2ModuleHeader Normal
highlight default link modula2ModuleTail Normal
highlight default link modula2ProcedureHeader Normal
highlight default link modula2ProcedureTail Normal

" lowline identifiers are rendered as errors if g:modula2_iso_allow_lowline is unset
if exists("g:modula2_iso_allow_lowline")
if g:modula2_iso_allow_lowline != 0
highlight default link modula2ProcedureLowlineIdent modula2HeaderIdentStyle
else
highlight default link modula2ProcedureLowlineIdent Error
endif
else
highlight default link modula2ProcedureLowlineIdent modula2HeaderIdentStyle
endif

" reserved words
highlight default link modula2Resword modula2ReswordStyle
highlight default link modula2ReswordModule modula2ReswordStyle
highlight default link modula2ReswordProcedure modula2ReswordStyle
highlight default link modula2ReswordEnd modula2ReswordStyle

" predefined identifiers
highlight default link modula2ConstIdent modula2ConstIdentStyle
highlight default link modula2TypeIdent modula2TypeIdentStyle
highlight default link modula2ProcIdent modula2ProcIdentStyle
highlight default link modula2FuncIdent modula2FuncIdentStyle
highlight default link modula2MacroIdent modula2MacroIdentStyle

" unsafe and non-portable identifiers
highlight default link modula2UnsafeIdent modula2UnsafeIdentStyle
highlight default link modula2NonPortableIdent modula2NonPortableIdentStyle

" user defined identifiers
highlight default link modula2Ident modula2UserDefIdentStyle

" lowline identifiers are rendered as errors if g:modula2_iso_allow_lowline is unset
if exists("g:modula2_iso_allow_lowline")
if g:modula2_iso_allow_lowline != 0
highlight default link modula2LowLineIdent modula2UserDefIdentStyle
else
highlight default link modula2LowLineIdent Error
endif
else
highlight default link modula2LowLineIdent modula2UserDefIdentStyle
endif

" literals
highlight default link modula2String modula2StringLiteralStyle
highlight default link modula2Num modula2NumericLiteralStyle

" octal literals are rendered as errors if g:modula2_iso_disallow_octals is set
if exists("g:modula2_iso_disallow_octals")
if g:modula2_iso_disallow_octals != 0
highlight default link modula2Octal Error
else
highlight default link modula2Octal modula2NumericLiteralStyle
endif
else
highlight default link modula2Octal modula2NumericLiteralStyle
endif

" punctuation
highlight default link modula2Punctuation modula2PunctuationStyle

" synonyms & and ~ are rendered as errors if g:modula2_iso_disallow_synonyms is set
if exists("g:modula2_iso_disallow_synonyms")
if g:modula2_iso_disallow_synonyms != 0
highlight default link modula2Synonym Error
else
highlight default link modula2Synonym modula2PunctuationStyle
endif
else
highlight default link modula2Synonym modula2PunctuationStyle
endif

" pragmas
highlight default link modula2Pragma modula2PragmaStyle
highlight default link modula2DialectTag modula2DialectTagStyle

" comments
highlight default link modula2Comment modula2CommentStyle
highlight default link modula2CommentKey modula2CommentKeyStyle

" technical debt markers
highlight default link modula2TechDebtMarker modula2TechDebtMarkerStyle

" disabled code
highlight default link modula2DisabledCode modula2DisabledCodeStyle

" illegal symbols
highlight default link modula2IllegalChar Error
highlight default link modula2IllegalIdent Error


let b:current_syntax = "m2iso"

" vim: ts=4

" END OF FILE
377 changes: 377 additions & 0 deletions runtime/syntax/modula2/opt/pim.vim
@@ -0,0 +1,377 @@
" Vim syntax file
" Language: Modula-2 (PIM)
" Maintainer: B.Kowarsch <trijezdci@moc.liamg>
" Last Change: 2016 August 22

" ----------------------------------------------------
" THIS FILE IS LICENSED UNDER THE VIM LICENSE
" see https://github.com/vim/vim/blob/master/LICENSE
" ----------------------------------------------------

" Remarks:
" Vim Syntax files are available for the following Modula-2 dialects:
" * for the PIM dialect : m2pim.vim (this file)
" * for the ISO dialect : m2iso.vim
" * for the R10 dialect : m2r10.vim

" -----------------------------------------------------------------------------
" This syntax description follows the 3rd and 4th editions of N.Wirth's Book
" Programming in Modula-2 (aka PIM) plus the following language extensions:
" * non-leading, non-trailing, non-consecutive lowlines _ in identifiers
" * widely supported non-standard types BYTE, LONGCARD and LONGBITSET
" * non-nesting code disabling tags ?< and >? at the start of a line
" -----------------------------------------------------------------------------

" Parameters:
"
" Vim's filetype script recognises Modula-2 dialect tags within the first 100
" lines of Modula-2 .def and .mod input files. The script sets filetype and
" dialect automatically when a valid dialect tag is found in the input file.
" The dialect tag for the PIM dialect is (*!m2pim*). It is recommended to put
" the tag immediately after the module header in the Modula-2 input file.
"
" 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 input file:
" if defined and set to 'm2pim', the default dialect is PIM.
"
" Variable g:modula2_pim_allow_lowline controls support for lowline in identifiers:
" if defined and set to a non-zero value, they are recognised, otherwise not
"
" Variable g:modula2_pim_disallow_octals controls the rendering of octal literals:
" if defined and set to a non-zero value, they are rendered as errors.
"
" Variable g:modula2_pim_disallow_synonyms controls the rendering of & and ~:
" if defined and set to a non-zero value, they are rendered as errors.
"
" Variables may be defined in Vim startup file .vimrc
"
" Examples:
" let g:modula2_default_dialect = 'm2pim'
" let g:modula2_pim_allow_lowline = 1
" let g:modula2_pim_disallow_octals = 1
" let g:modula2_pim_disallow_synonyms = 1


if exists("b:current_syntax")
finish
endif

" Modula-2 is case sensitive
syn case match


" -----------------------------------------------------------------------------
" Reserved Words
" -----------------------------------------------------------------------------
syn keyword modula2Resword AND ARRAY BEGIN BY CASE CONST DEFINITION DIV DO ELSE
syn keyword modula2Resword ELSIF EXIT EXPORT FOR FROM IF IMPLEMENTATION IMPORT
syn keyword modula2Resword IN LOOP MOD NOT OF OR POINTER QUALIFIED RECORD REPEAT
syn keyword modula2Resword RETURN SET THEN TO TYPE UNTIL VAR WHILE WITH


" -----------------------------------------------------------------------------
" Builtin Constant Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2ConstIdent FALSE NIL TRUE


" -----------------------------------------------------------------------------
" Builtin Type Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2TypeIdent BITSET BOOLEAN CHAR PROC
syn keyword modula2TypeIdent CARDINAL INTEGER LONGINT REAL LONGREAL


" -----------------------------------------------------------------------------
" Builtin Procedure and Function Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2ProcIdent CAP DEC EXCL HALT INC INCL
syn keyword modula2FuncIdent ABS CHR FLOAT HIGH MAX MIN ODD ORD SIZE TRUNC VAL


" -----------------------------------------------------------------------------
" Wirthian Macro Identifiers
" -----------------------------------------------------------------------------
syn keyword modula2MacroIdent NEW DISPOSE


" -----------------------------------------------------------------------------
" Unsafe Facilities via Pseudo-Module SYSTEM
" -----------------------------------------------------------------------------
syn keyword modula2UnsafeIdent ADDRESS PROCESS WORD
syn keyword modula2UnsafeIdent ADR TSIZE NEWPROCESS TRANSFER SYSTEM


" -----------------------------------------------------------------------------
" Non-Portable Language Extensions
" -----------------------------------------------------------------------------
syn keyword modula2NonPortableIdent BYTE LONGCARD LONGBITSET


" -----------------------------------------------------------------------------
" User Defined Identifiers
" -----------------------------------------------------------------------------
syn match modula2Ident "[a-zA-Z][a-zA-Z0-9]*\(_\)\@!"
syn match modula2LowLineIdent "[a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)\+"


" -----------------------------------------------------------------------------
" String Literals
" -----------------------------------------------------------------------------
syn region modula2String start=/"/ end=/"/ oneline
syn region modula2String start=/'/ end=/'/ oneline


" -----------------------------------------------------------------------------
" Numeric Literals
" -----------------------------------------------------------------------------
syn match modula2Num
\ "\(\([0-7]\+\)[BC]\@!\|[89]\)[0-9]*\(\.[0-9]\+\([eE][+-]\?[0-9]\+\)\?\)\?"
syn match modula2Num "[0-9A-F]\+H"
syn match modula2Octal "[0-7]\+[BC]"


" -----------------------------------------------------------------------------
" Punctuation
" -----------------------------------------------------------------------------
syn match modula2Punctuation
\ "\.\|[,:;]\|\*\|[/+-]\|\#\|[=<>]\|\^\|\[\|\]\|(\(\*\)\@!\|[){}]"
syn match modula2Synonym "[&~]"


" -----------------------------------------------------------------------------
" Pragmas
" -----------------------------------------------------------------------------
syn region modula2Pragma start="(\*\$" end="\*)"
syn match modula2DialectTag "(\*!m2pim\(+[a-z0-9]\+\)\?\*)"

" -----------------------------------------------------------------------------
" Block Comments
" -----------------------------------------------------------------------------
syn region modula2Comment start="(\*\(\$\|!m2pim\(+[a-z0-9]\+\)\?\*)\)\@!" end="\*)"
\ contains = modula2Comment, modula2CommentKey, modula2TechDebtMarker
syn match modula2CommentKey "[Aa]uthor[s]\?\|[Cc]opyright\|[Ll]icense\|[Ss]ynopsis"
syn match modula2CommentKey "\([Pp]re\|[Pp]ost\|[Ee]rror\)\-condition[s]\?:"


" -----------------------------------------------------------------------------
" Technical Debt Markers
" -----------------------------------------------------------------------------
syn keyword modula2TechDebtMarker contained DEPRECATED FIXME
syn match modula2TechDebtMarker "TODO[:]\?" contained

" -----------------------------------------------------------------------------
" Disabled Code Sections
" -----------------------------------------------------------------------------
syn region modula2DisabledCode start="^?<" end="^>?"


" -----------------------------------------------------------------------------
" Headers
" -----------------------------------------------------------------------------
" !!! this section must be second last !!!

" new module header
syn match modula2ModuleHeader
\ "MODULE\( [A-Z][a-zA-Z0-9]*\)\?"
\ contains = modula2ReswordModule, modula2ModuleIdent

syn match modula2ModuleIdent
\ "[A-Z][a-zA-Z0-9]*" contained

syn match modula2ModuleTail
\ "END [A-Z][a-zA-Z0-9]*\.$"
\ contains = modula2ReswordEnd, modula2ModuleIdent, modula2Punctuation

" new procedure header
syn match modula2ProcedureHeader
\ "PROCEDURE\( [a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)*\)\?"
\ contains = modula2ReswordProcedure,
\ modula2ProcedureIdent, modula2ProcedureLowlineIdent, modula2IllegalChar, modula2IllegalIdent

syn match modula2ProcedureIdent
\ "\([a-zA-Z]\)\([a-zA-Z0-9]*\)" contained

syn match modula2ProcedureLowlineIdent
\ "[a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)\+" contained

syn match modula2ProcedureTail
\ "END\( \([a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)*\)[.;]$\)\?"
\ contains = modula2ReswordEnd,
\ modula2ProcedureIdent, modula2ProcedureLowLineIdent,
\ modula2Punctuation, modula2IllegalChar, modula2IllegalIdent

syn keyword modula2ReswordModule contained MODULE
syn keyword modula2ReswordProcedure contained PROCEDURE
syn keyword modula2ReswordEnd contained END


" -----------------------------------------------------------------------------
" Illegal Symbols
" -----------------------------------------------------------------------------
" !!! this section must be last !!!

" any '`' '!' '@ ''$' '%' or '\'
syn match modula2IllegalChar "[`!@$%\\]"

" any solitary sequence of '_'
syn match modula2IllegalChar "\<_\+\>"

" any '?' at start of line if not followed by '<'
syn match modula2IllegalChar "^?\(<\)\@!"

" any '?' not following '>' at start of line
syn match modula2IllegalChar "\(\(^>\)\|\(^\)\)\@<!?"

" any identifiers with leading occurrences of '_'
syn match modula2IllegalIdent "_\+[a-zA-Z][a-zA-Z0-9]*\(_\+[a-zA-Z0-9]*\)*"

" any identifiers containing consecutive occurences of '_'
syn match modula2IllegalIdent
\ "[a-zA-Z][a-zA-Z0-9]*\(_[a-zA-Z0-9]\+\)*\(__\+[a-zA-Z0-9]\+\(_[a-zA-Z0-9]\+\)*\)\+"

" any identifiers with trailing occurrences of '_'
syn match modula2IllegalIdent "[a-zA-Z][a-zA-Z0-9]*\(_\+[a-zA-Z0-9]\+\)*_\+\>"


" -----------------------------------------------------------------------------
" Define Rendering Styles
" -----------------------------------------------------------------------------

" highlight default link modula2PredefIdentStyle Keyword
" highlight default link modula2ConstIdentStyle modula2PredefIdentStyle
" highlight default link modula2TypeIdentStyle modula2PredefIdentStyle
" highlight default link modula2ProcIdentStyle modula2PredefIdentStyle
" highlight default link modula2FuncIdentStyle modula2PredefIdentStyle
" highlight default link modula2MacroIdentStyle modula2PredefIdentStyle

highlight default link modula2ConstIdentStyle Constant
highlight default link modula2TypeIdentStyle Type
highlight default link modula2ProcIdentStyle Function
highlight default link modula2FuncIdentStyle Function
highlight default link modula2MacroIdentStyle Function
highlight default link modula2UnsafeIdentStyle Question
highlight default link modula2NonPortableIdentStyle Question
highlight default link modula2StringLiteralStyle String
highlight default link modula2CommentStyle Comment
highlight default link modula2PragmaStyle PreProc
highlight default link modula2DialectTagStyle SpecialComment
highlight default link modula2TechDebtMarkerStyle SpecialComment
highlight default link modula2ReswordStyle Keyword
highlight default link modula2HeaderIdentStyle Function
highlight default link modula2UserDefIdentStyle Normal
highlight default link modula2NumericLiteralStyle Number
highlight default link modula2PunctuationStyle Delimiter
highlight default link modula2CommentKeyStyle SpecialComment
highlight default link modula2DisabledCodeStyle NonText

" -----------------------------------------------------------------------------
" Assign Rendering Styles
" -----------------------------------------------------------------------------

" headers
highlight default link modula2ModuleIdent modula2HeaderIdentStyle
highlight default link modula2ProcedureIdent modula2HeaderIdentStyle
highlight default link modula2ModuleHeader Normal
highlight default link modula2ModuleTail Normal
highlight default link modula2ProcedureHeader Normal
highlight default link modula2ProcedureTail Normal

" lowline identifiers are rendered as errors if g:modula2_pim_allow_lowline is unset
if exists("g:modula2_pim_allow_lowline")
if g:modula2_pim_allow_lowline != 0
highlight default link modula2ProcedureLowlineIdent modula2HeaderIdentStyle
else
highlight default link modula2ProcedureLowlineIdent Error
endif
else
highlight default link modula2ProcedureLowlineIdent Error
endif

" reserved words
highlight default link modula2Resword modula2ReswordStyle
highlight default link modula2ReswordModule modula2ReswordStyle
highlight default link modula2ReswordProcedure modula2ReswordStyle
highlight default link modula2ReswordEnd modula2ReswordStyle

" predefined identifiers
highlight default link modula2ConstIdent modula2PredefConstStyle
highlight default link modula2TypeIdent modula2PredefTypeStyle
highlight default link modula2ProcIdent modula2PredefProcStyle
highlight default link modula2FuncIdent modula2PredefFuncStyle
highlight default link modula2MacroIdent modula2PredefMacroStyle

" unsafe and non-portable identifiers
highlight default link modula2UnsafeIdent modula2UnsafeIdentStyle
highlight default link modula2NonPortableIdent modula2NonPortableIdentStyle

" user defined identifiers
highlight default link modula2Ident modula2UserDefIdentStyle

" lowline identifiers are rendered as errors if g:modula2_pim_allow_lowline is unset
if exists("g:modula2_pim_allow_lowline")
if g:modula2_pim_allow_lowline != 0
highlight default link modula2LowLineIdent modula2UserDefIdentStyle
else
highlight default link modula2LowLineIdent Error
endif
else
highlight default link modula2LowLineIdent Error
endif

" literals
highlight default link modula2String modula2StringLiteralStyle
highlight default link modula2Num modula2NumericLiteralStyle

" octal literals are rendered as errors if g:modula2_pim_disallow_octals is set
if exists("g:modula2_pim_disallow_octals")
if g:modula2_pim_disallow_octals != 0
highlight default link modula2Octal Error
else
highlight default link modula2Octal modula2NumericLiteralStyle
endif
else
highlight default link modula2Octal modula2NumericLiteralStyle
endif

" punctuation
highlight default link modula2Punctuation modula2PunctuationStyle

" synonyms & and ~ are rendered as errors if g:modula2_pim_disallow_synonyms is set
if exists("g:modula2_pim_disallow_synonyms")
if g:modula2_pim_disallow_synonyms != 0
highlight default link modula2Synonym Error
else
highlight default link modula2Synonym modula2PunctuationStyle
endif
else
highlight default link modula2Synonym modula2PunctuationStyle
endif

" pragmas
highlight default link modula2Pragma modula2PragmaStyle
highlight default link modula2DialectTag modula2DialectTagStyle

" comments
highlight default link modula2Comment modula2CommentStyle
highlight default link modula2CommentKey modula2CommentKeyStyle

" technical debt markers
highlight default link modula2TechDebtMarker modula2TechDebtMarkerStyle

" disabled code
highlight default link modula2DisabledCode modula2DisabledCodeStyle

" illegal symbols
highlight default link modula2IllegalChar Error
highlight default link modula2IllegalIdent Error


let b:current_syntax = "m2pim"

" vim: ts=4

" END OF FILE
452 changes: 452 additions & 0 deletions runtime/syntax/modula2/opt/r10.vim

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_00.dump
@@ -0,0 +1,20 @@
>(+0#0000e05#ffffff0|*| |M|o|d|u|l|a|-|2| |I|S|O| |T|e|s|t| |F|i|l|e| |f|o|r| |V|i|m| |S|y|n|t|a|x| |C|o|l|o|u|r|i|n|g| |*|)| +0#0000000&@21
@75
|(+0#0000e05&|*| |-@49| +0#0000000&@21
| +0#0000e05&|*| |T|H|I|S| |F|I|L|E| |I|S| |L|I|C|E|N|S|E|D| |U|N|D|E|R| |T|H|E| |V|I|M| |L|I|C|E|N|S|E| +0#0000000&@28
| +0#0000e05&|*| |s|e@1| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|b|l|o|b|/|m|a|s|t|e|r|/|L|I|C|E|N|S|E| +0#0000000&@21
| +0#0000e05&|*| |-@49| |*|)| +0#0000000&@18
@75
@75
|D+0#af5f00255&|E|F|I|N|I|T|I|O|N| +0#0000000&|M+0#af5f00255&|O|D|U|L|E| +0#0000000&|F+0#00e0e07&|o@1|b|a|r|;+0#e000e06&| +0#0000000&|(+0#e000e06&|*|!|m|2|i|s|o|*|)| +0#0000000&@38
@75
|F+0#af5f00255&|R|O|M| +0#0000000&|S+0#00e0003&|Y|S|T|E|M| +0#0000000&|I+0#af5f00255&|M|P|O|R|T| +0#0000000&|L+0#00e0003&|O|C|,+0#e000e06&| +0#0000000&|W+0#00e0003&|O|R|D|,+0#e000e06&| +0#0000000&|A+0#00e0003&|D@1|R|E|S@1|;+0#e000e06&| +0#0000000&@36
@75
|C+0#af5f00255&|O|N|S|T| +0#0000000&|M|a|x|F|o@1| |=+0#e000e06&| +0#0000000&|1+0#e000002&|.|0|;+0#e000e06&| +0#0000000&|L|F| |=+0#e000e06&| +0#0000000&|C+0#00e0e07&|H|R|(+0#e000e06&|1+0#e000002&|0|)+0#e000e06&|;| +0#0000000&@41
@75
|T+0#af5f00255&|Y|P|E| +0#0000000&|F|o@1| |=+0#e000e06&| +0#0000000&|P+0#af5f00255&|O|I|N|T|E|R| +0#0000000&|T+0#af5f00255&|O| +0#0000000&|B|a|r|;+0#e000e06&| +0#0000000&@48
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |c|o|n|s|t|a|n|t|s| |*|)| +0#0000000&@48
|F+0#e000002&|A|L|S|E| +0#0000000&|N+0#e000002&|I|L| +0#0000000&|T+0#e000002&|R|U|E| +0#0000000&|I+0#e000002&|N|T|E|R@1|U|P|T|I|B|L|E| +0#0000000&|U+0#e000002&|N|I|N|T|E|R@1|U|P|T|I|B|L|E| +0#0000000&@30
@75
|"|i|n|p|u|t|/|m|o|d|u|l|a|2|_|i|s|o|.|d|e|f|"| |1@1|4|L|,| |2|3|1|8|B| @21|1|,|1| @10|T|o|p|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_01.dump
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|T+0#af5f00255&|Y|P|E| +0#0000000&|F|o@1| |=+0#e000e06&| +0#0000000&|P+0#af5f00255&|O|I|N|T|E|R| +0#0000000&|T+0#af5f00255&|O| +0#0000000&|B|a|r|;+0#e000e06&| +0#0000000&@48
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |c|o|n|s|t|a|n|t|s| |*|)| +0#0000000&@48
|F+0#e000002&|A|L|S|E| +0#0000000&|N+0#e000002&|I|L| +0#0000000&|T+0#e000002&|R|U|E| +0#0000000&|I+0#e000002&|N|T|E|R@1|U|P|T|I|B|L|E| +0#0000000&|U+0#e000002&|N|I|N|T|E|R@1|U|P|T|I|B|L|E| +0#0000000&@30
> @74
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |t|y|p|e|s| |*|)| +0#0000000&@52
|B+0#00e0003&|I|T|S|E|T| +0#0000000&|B+0#00e0003&|O@1|L|E|A|N| +0#0000000&|C+0#00e0003&|H|A|R| +0#0000000&|P+0#00e0003&|R|O|C| +0#0000000&|C+0#00e0003&|A|R|D|I|N|A|L| +0#0000000&|I+0#00e0003&|N|T|E|G|E|R| +0#0000000&|L+0#00e0003&|O|N|G|I|N|T| +0#0000000&|R+0#00e0003&|E|A|L| +0#0000000&|L+0#00e0003&|O|N|G|R|E|A|L| +0#0000000&@11
|C+0#00e0003&|O|M|P|L|E|X| +0#0000000&|L+0#00e0003&|O|N|G|C|O|M|P|L|E|X| +0#0000000&|P+0#00e0003&|R|O|T|E|C|T|I|O|N| +0#0000000&@44
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |p|r|o|c|e|d|u|r|e|s| |*|)| +0#0000000&@47
|C+0#00e0e07&|A|P| +0#0000000&|D+0#00e0e07&|E|C| +0#0000000&|E+0#00e0e07&|X|C|L| +0#0000000&|H+0#00e0e07&|A|L|T| +0#0000000&|I+0#00e0e07&|N|C| +0#0000000&|I+0#00e0e07&|N|C|L| +0#0000000&@48
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |f|u|n|c|t|i|o|n|s| |*|)| +0#0000000&@48
|A+0#00e0e07&|B|S| +0#0000000&|C+0#00e0e07&|H|R| +0#0000000&|C+0#00e0e07&|M|P|L|X| +0#0000000&|F+0#00e0e07&|L|O|A|T| +0#0000000&|H+0#00e0e07&|I|G|H| +0#0000000&|I+0#00e0e07&|M| +0#0000000&|I+0#00e0e07&|N|T| +0#0000000&|L+0#00e0e07&|E|N|G|T|H| +0#0000000&|L+0#00e0e07&|F|L|O|A|T| +0#0000000&|M+0#00e0e07&|A|X| +0#0000000&|M+0#00e0e07&|I|N| +0#0000000&|O+0#00e0e07&|D@1| +0#0000000&|O+0#00e0e07&|R|D| +0#0000000&|R+0#00e0e07&|E| +0#0000000&|S+0#00e0e07&|I|Z|E| +0#0000000&|T+0#00e0e07&|R|U|N|C
| +0#0000000&|V+0#00e0e07&|A|L| +0#0000000&@70
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |m|a|c|r|o|s| |*|)| +0#0000000&@51
|N+0#00e0e07&|E|W| +0#0000000&|D+0#00e0e07&|I|S|P|O|S|E| +0#0000000&@63
@57|1|9|,|0|-|1| @7|1|3|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_02.dump
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|(+0#0000e05&|*| |u|n|s|a|f|e| |b|u|i|l|t|i|n|s| |*|)| +0#0000000&@53
|A+0#00e0003&|D@1|R|E|S@1| +0#0000000&|B+0#00e0003&|Y|T|E| +0#0000000&|L+0#00e0003&|O|C| +0#0000000&|W+0#00e0003&|O|R|D| +0#0000000&|A+0#00e0003&|D|R| +0#0000000&|C+0#00e0003&|A|S|T| +0#0000000&|T+0#00e0003&|S|I|Z|E| +0#0000000&|S+0#00e0003&|Y|S|T|E|M| +0#0000000&@31
|M+0#00e0003&|A|K|E|A|D|R| +0#0000000&|A+0#00e0003&|D@1|A|D|R| +0#0000000&|S+0#00e0003&|U|B|A|D|R| +0#0000000&|D+0#00e0003&|I|F|A|D|R| +0#0000000&|R+0#00e0003&|O|T|A|T|E| +0#0000000&|S+0#00e0003&|H|I|F|T| +0#0000000&@33
@75
>(+0#0000e05&|*| |n|o|n|-|s|t|a|n|d|a|r|d| |l|a|n|g|u|a|g|e| |e|x|t|e|n|s|i|o|n|s| |*|)| +0#0000000&@36
|L+0#00e0003&|O|N|G|C|A|R|D| +0#0000000&|L+0#00e0003&|O|N|G|B|I|T|S|E|T| +0#0000000&@55
@75
|(+0#0000e05&|*| |u|s|e|r| |d|e|f|i|n|e|d| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@44
|f|o@1|b|a|r| |F|o@1|b|a|r| |F|o@1|B|a|r| |f|o@1|1|2|3| |f|o@1|_|b|a|r| @39
@75
|(+0#0000e05&|*| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@53
|s|t|r| |:+0#e000e06&|=| +0#0000000&|"+0#e000002&|f|o@1| |'|b|a|r|'| |b|a|z|"|;+0#e000e06&| +0#0000000&@51
|s|t|r| |:+0#e000e06&|=| +0#0000000&|'+0#e000002&|f|o@1| |"|b|a|r|"| |b|a|z|'|;+0#e000e06&| +0#0000000&@51
@75
|(+0#0000e05&|*| |n|u|m|e|r|i|c| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@52
|0+0#e000002&|F@2|H|,+0#e000e06&| +0#0000000&|1+0#e000002&|.|2|3|,+0#e000e06&| +0#0000000&|1+0#e000002&|.|2|3|e|-|4|5|,+0#e000e06&| +0#0000000&|1+0#e000002&|0@2| +0#0000000&@47
@75
|(+0#0000e05&|*| |o|c|t|a|l| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@54
@57|3|7|,|1| @9|3|2|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_03.dump
@@ -0,0 +1,20 @@
|(+0#0000e05#ffffff0|*| |o|c|t|a|l| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@54
|n| |:+0#e000e06&|=| +0#0000000&|0+0#e000002&|3|7@1|B|;+0#e000e06&| +0#0000000&|c|h| |:+0#e000e06&|=| +0#0000000&|0+0#e000002&|3|7@1|C|;+0#e000e06&| +0#0000000&@50
@75
|(+0#0000e05&|*| |p|r|a|g|m|a|s| |*|)| +0#0000000&@61
|<+0#e000e06&|*|$|f|o@1|*|>| +0#0000000&@66
> @74
|(+0#0000e05&|*| |b|l|o|c|k| |c|o|m@1|e|n|t|s| |w|i|t|h| |e|m|p|h|a|s|i|s| |*|)| +0#0000000&@40
|(+0#0000e05&|*| |c+0#e000e06&|o|p|y|r|i|g|h|t| +0#0000e05&|(|c|)| |J|u|r@1|a|s|i|c| |I|n|c|.| +0#0000000&@44
| +0#0000e05&@2|a+0#e000e06&|u|t|h|o|r| +0#0000e05&|F|r|e|d| |F|l|i|n|t|s|t|o|n|e| |S|r|.| +0#0000000&@45
| +0#0000e05&@2|l+0#e000e06&|i|c|e|n|s|e| +0#0000e05&|s|e@1| |L|I|C|E|N|S|E| |f|i|l|e|.| |*|)| +0#0000000&@43
@75
|(+0#0000e05&|*| |p+0#e000e06&|r|e|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|f|o@1| |b|a|r| |b|a|z| |b|a|m| |b|o@1| |d|o@1|d|l|e| |w|a|h|.| +0#0000000&@24
| +0#0000e05&@2|p+0#e000e06&|o|s|t|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|f|o@1|d|l|e| |b|a|b@1|l|e| |b|o|z|o| |b|i|m| |b|a|m| |d|a|n|g|.| +0#0000000&@22
| +0#0000e05&@2|e+0#e000e06&|r@1|o|r|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|d|a|d|a| |j|i|n|g|l|e| |j|u|n|g|l|e| |b|o|g@1|l|e| |d|e@1| |b|o@1|.| |*|)| +0#0000000&@16
@75
|(+0#0000e05&|*| |t|e|c|h|n|i|c|a|l| |d|e|b|t| |m|a|r|k|e|r|s| |*|)| +0#0000000&@46
|(+0#0000e05&|*| |T+0#e000e06&|O|D|O|:| +0#0000e05&|.@2| |*|)| +0#0000000&@59
|(+0#0000e05&|*| |F+0#e000e06&|I|X|M|E| +0#0000e05&|*|)| +0#0000000&@63
|(+0#0000e05&|*| |D+0#e000e06&|E|P|R|E|C|A|T|E|D| +0#0000e05&|*|)| +0#0000000&@58
@57|5@1|,|0|-|1| @7|5|1|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_04.dump
@@ -0,0 +1,20 @@
|(+0#0000e05#ffffff0|*| |D+0#e000e06&|E|P|R|E|C|A|T|E|D| +0#0000e05&|*|)| +0#0000000&@58
@75
|(+0#0000e05&|*| |p|r|o|c|e|d|u|r|e|s| |*|)| +0#0000000&@58
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|N+0#00e0e07&|e|w|F|o@1|W|i|t|h|B|a|r| +0#0000000&|(+0#e000e06&| +0#0000000&|V+0#af5f00255&|A|R| +0#0000000&|f|o@1|:+0#e000e06&| +0#0000000&|F|o@1|;+0#e000e06&| +0#0000000&|b|a|r| |:+0#e000e06&| +0#0000000&|I+0#00e0003&|N|T|E|G|E|R| +0#0000000&|)+0#e000e06&|;| +0#0000000&@18
|B+0#af5f00255&|E|G|I|N| +0#0000000&@69
@2>N+0#00e0e07&|E|W|(+0#e000e06&|f+0#0000000&|o@1|)+0#e000e06&|;| +0#0000000&@63
@2|f|o@1|^+0#e000e06&|.|b+0#0000000&|a|r| |:+0#e000e06&|=| +0#0000000&|b|a|r|;+0#e000e06&| +0#0000000&@56
@2|R+0#af5f00255&|E|T|U|R|N| +0#0000000&@66
|E+0#af5f00255&|N|D| +0#0000000&|S+0#00e0e07&|e|t|B|a|r|;+0#e000e06&| +0#0000000&@63
@75
|(+0#0000e05&|*| |f|u|n|c|t|i|o|n|s| |*|)| +0#0000000&@59
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|(+0#e000e06&| +0#0000000&|f|o@1| |:+0#e000e06&| +0#0000000&|F|o@1| |)+0#e000e06&| +0#0000000&|:+0#e000e06&| +0#0000000&|I+0#00e0003&|N|T|E|G|E|R|;+0#e000e06&| +0#0000000&@36
|B+0#af5f00255&|E|G|I|N| +0#0000000&@69
@2|I+0#af5f00255&|F| +0#0000000&|f|o@1| |=+0#e000e06&| +0#0000000&|N+0#e000002&|I|L| +0#0000000&|T+0#af5f00255&|H|E|N| +0#0000000&@55
@4|H+0#00e0e07&|A|L|T| +0#0000000&@66
@2|E+0#af5f00255&|L|S|E| +0#0000000&@68
@4|R+0#af5f00255&|E|T|U|R|N| +0#0000000&|f|o@1|^+0#e000e06&|.|b+0#0000000&|a|r| @55
@2|E+0#af5f00255&|N|D| +0#0000000&|(+0#0000e05&|*| |I|F| |*|)| +0#0000000&@60
|E+0#af5f00255&|N|D| +0#0000000&|b+0#00e0e07&|a|r|;+0#e000e06&| +0#0000000&@66
@57|7|3|,|3| @9|7|0|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_05.dump
@@ -0,0 +1,20 @@
|E+0#af5f00255#ffffff0|N|D| +0#0000000&|b+0#00e0e07&|a|r|;+0#e000e06&| +0#0000000&@66
@75
|(+0#0000e05&|*| |d|i|s|a|b|l|e|d| |c|o|d|e| |*|)| +0#0000000&@55
|?+0#4040ff13&|<| +0#0000000&@72
|W+0#4040ff13&|H|I|L|E| |f|o@1| |=| |b|a|r| |D|O| +0#0000000&@56
| +0#4040ff13&@1>b|a|z|(|b|a|m|,| |b|o@1|)| +0#0000000&@59
|E+0#4040ff13&|N|D| |(|*| |W|H|I|L|E| |*|)|;| +0#0000000&@58
|>+0#4040ff13&|?| +0#0000000&@72
@75
|(+0#0000e05&|*| |s|y|n|o|n|y|m|s| |*|)| +0#0000000&@60
|@+0#e000e06&| +0#0000000&@1|&+0#e000e06&| +0#0000000&@1|~+0#e000e06&| +0#0000000&@67
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |c|h|a|r|a|c|t|e|r|s| |*|)| +0#0000000&@50
|`+0#ffffff16#ff404010| +0#0000000#ffffff0@1|!+0#ffffff16#ff404010| +0#0000000#ffffff0@1|$+0#ffffff16#ff404010| +0#0000000#ffffff0@1|%+0#ffffff16#ff404010| +0#0000000#ffffff0@1|\+0#ffffff16#ff404010| +0#0000000#ffffff0@1|?+0#ffffff16#ff404010| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010| +0#0000000#ffffff0@55
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@49
@75
|_+0#ffffff16#ff404010|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@26
@75
@57|9|1|,|3| @9|8|9|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_06.dump
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|b+0#ffffff16#ff404010|a|r|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_| +0#0000000#ffffff0@26
@75
|_+0#ffffff16#ff404010@1|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@22
@75
>b+0#ffffff16#ff404010|a|r|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_@1|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1| +0#0000000#ffffff0@35
@75
@75
|E+0#af5f00255&|N|D| +0#0000000&|F+0#00e0e07&|o@1|b|a|r|.+0#e000e06&| +0#0000000&@63
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|0|9|,|1| @8|B|o|t|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_iso_99.dump
@@ -0,0 +1,20 @@
|@+0#e000e06#ffffff0| +0#0000000&@1|&+0#e000e06&| +0#0000000&@1|~+0#e000e06&| +0#0000000&@67
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |c|h|a|r|a|c|t|e|r|s| |*|)| +0#0000000&@50
|`+0#ffffff16#ff404010| +0#0000000#ffffff0@1|!+0#ffffff16#ff404010| +0#0000000#ffffff0@1|$+0#ffffff16#ff404010| +0#0000000#ffffff0@1|%+0#ffffff16#ff404010| +0#0000000#ffffff0@1|\+0#ffffff16#ff404010| +0#0000000#ffffff0@1|?+0#ffffff16#ff404010| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010| +0#0000000#ffffff0@55
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@49
@75
|_+0#ffffff16#ff404010|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@26
@75
|b+0#ffffff16#ff404010|a|r|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_| +0#0000000#ffffff0@26
@75
|_+0#ffffff16#ff404010@1|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_@1|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1| +0#0000000#ffffff0@35
@75
@75
>E+0#af5f00255&|N|D| +0#0000000&|F+0#00e0e07&|o@1|b|a|r|.+0#e000e06&| +0#0000000&@63
@57|1@1|4|,|1| @8|B|o|t|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_pim_00.dump
@@ -0,0 +1,20 @@
>(+0#0000e05#ffffff0|*| |M|o|d|u|l|a|-|2| |P|I|M| |T|e|s|t| |F|i|l|e| |f|o|r| |V|i|m| |S|y|n|t|a|x| |C|o|l|o|u|r|i|n|g| |*|)| +0#0000000&@21
@75
|(+0#0000e05&|*| |-@49| +0#0000000&@21
| +0#0000e05&|*| |T|H|I|S| |F|I|L|E| |I|S| |L|I|C|E|N|S|E|D| |U|N|D|E|R| |T|H|E| |V|I|M| |L|I|C|E|N|S|E| +0#0000000&@28
| +0#0000e05&|*| |s|e@1| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|b|l|o|b|/|m|a|s|t|e|r|/|L|I|C|E|N|S|E| +0#0000000&@21
| +0#0000e05&|*| |-@49| |*|)| +0#0000000&@18
@75
|D+0#af5f00255&|E|F|I|N|I|T|I|O|N| +0#0000000&|M+0#af5f00255&|O|D|U|L|E| +0#0000000&|F+0#00e0e07&|o@1|b|a|r|;+0#e000e06&| +0#0000000&|(+0#e000e06&|*|!|m|2|p|i|m|*|)| +0#0000000&@38
@75
|F+0#af5f00255&|R|O|M| +0#0000000&|S+0#00e0003&|Y|S|T|E|M| +0#0000000&|I+0#af5f00255&|M|P|O|R|T| +0#0000000&|W+0#00e0003&|O|R|D|,+0#e000e06&| +0#0000000&|A+0#00e0003&|D@1|R|E|S@1|;+0#e000e06&| +0#0000000&@41
@75
|C+0#af5f00255&|O|N|S|T| +0#0000000&|M|a|x|F|o@1| |=+0#e000e06&| +0#0000000&|1+0#e000002&|.|0|;+0#e000e06&| +0#0000000&|L|F| |=+0#e000e06&| +0#0000000&|C|H|R|(+0#e000e06&|1+0#e000002&|0|)+0#e000e06&|;| +0#0000000&@41
@75
|T+0#af5f00255&|Y|P|E| +0#0000000&|F|o@1| |=+0#e000e06&| +0#0000000&|P+0#af5f00255&|O|I|N|T|E|R| +0#0000000&|T+0#af5f00255&|O| +0#0000000&|B|a|r|;+0#e000e06&| +0#0000000&@48
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |c|o|n|s|t|a|n|t|s| |*|)| +0#0000000&@48
|F|A|L|S|E| |N|I|L| |T|R|U|E| @60
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |t|y|p|e|s| |*|)| +0#0000000&@52
|"|i|n|p|u|t|/|m|o|d|u|l|a|2|_|p|i|m|.|d|e|f|"| |1@2|L|,| |2|1|9|7|B| @21|1|,|1| @10|T|o|p|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_pim_01.dump
@@ -0,0 +1,20 @@
|T+0#af5f00255#ffffff0|Y|P|E| +0#0000000&|F|o@1| |=+0#e000e06&| +0#0000000&|P+0#af5f00255&|O|I|N|T|E|R| +0#0000000&|T+0#af5f00255&|O| +0#0000000&|B|a|r|;+0#e000e06&| +0#0000000&@48
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |c|o|n|s|t|a|n|t|s| |*|)| +0#0000000&@48
|F|A|L|S|E| |N|I|L| |T|R|U|E| @60
@75
>(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |t|y|p|e|s| |*|)| +0#0000000&@52
|B|I|T|S|E|T| |B|O@1|L|E|A|N| |C|H|A|R| |P|R|O|C| |C|A|R|D|I|N|A|L| |I|N|T|E|G|E|R| |L|O|N|G|I|N|T| |R|E|A|L| |L|O|N|G|R|E|A|L| @11
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |p|r|o|c|e|d|u|r|e|s| |*|)| +0#0000000&@47
|C|A|P| |D|E|C| |E|X|C|L| |H|A|L|T| |I|N|C| |I|N|C|L| @48
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |f|u|n|c|t|i|o|n|s| |*|)| +0#0000000&@48
|A|B|S| |C|H|R| |F|L|O|A|T| |H|I|G|H| |M|A|X| |M|I|N| |O|D@1| |O|R|D| |S|I|Z|E| |T|R|U|N|C| |V|A|L| @25
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |m|a|c|r|o|s| |*|)| +0#0000000&@51
|N|E|W| |D|I|S|P|O|S|E| @63
@75
|(+0#0000e05&|*| |u|n|s|a|f|e| |b|u|i|l|t|i|n|s| |*|)| +0#0000000&@53
|A+0#00e0003&|D@1|R|E|S@1| +0#0000000&|P+0#00e0003&|R|O|C|E|S@1| +0#0000000&|W+0#00e0003&|O|R|D| +0#0000000&|A+0#00e0003&|D|R| +0#0000000&|T+0#00e0003&|S|I|Z|E| +0#0000000&|N+0#00e0003&|E|W|P|R|O|C|E|S@1| +0#0000000&|T+0#00e0003&|R|A|N|S|F|E|R| +0#0000000&|S+0#00e0003&|Y|S|T|E|M| +0#0000000&@17
@57|1|9|,|1| @9|1|4|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_pim_02.dump
@@ -0,0 +1,20 @@
|A+0#00e0003#ffffff0|D@1|R|E|S@1| +0#0000000&|P+0#00e0003&|R|O|C|E|S@1| +0#0000000&|W+0#00e0003&|O|R|D| +0#0000000&|A+0#00e0003&|D|R| +0#0000000&|T+0#00e0003&|S|I|Z|E| +0#0000000&|N+0#00e0003&|E|W|P|R|O|C|E|S@1| +0#0000000&|T+0#00e0003&|R|A|N|S|F|E|R| +0#0000000&|S+0#00e0003&|Y|S|T|E|M| +0#0000000&@17
@75
|(+0#0000e05&|*| |n|o|n|-|s|t|a|n|d|a|r|d| |l|a|n|g|u|a|g|e| |e|x|t|e|n|s|i|o|n|s| |*|)| +0#0000000&@36
|B+0#00e0003&|Y|T|E| +0#0000000&|L+0#00e0003&|O|N|G|C|A|R|D| +0#0000000&|L+0#00e0003&|O|N|G|B|I|T|S|E|T| +0#0000000&@50
@75
>(+0#0000e05&|*| |u|s|e|r| |d|e|f|i|n|e|d| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@44
|f|o@1|b|a|r| |F|o@1|b|a|r| |F|o@1|B|a|r| |f|o@1|1|2|3| |f+0#ffffff16#ff404010|o@1|_|b|a|r| +0#0000000#ffffff0@39
@75
|(+0#0000e05&|*| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@53
|s|t|r| |:+0#e000e06&|=| +0#0000000&|"+0#e000002&|f|o@1| |'|b|a|r|'| |b|a|z|"|;+0#e000e06&| +0#0000000&@51
|s|t|r| |:+0#e000e06&|=| +0#0000000&|'+0#e000002&|f|o@1| |"|b|a|r|"| |b|a|z|'|;+0#e000e06&| +0#0000000&@51
@75
|(+0#0000e05&|*| |n|u|m|e|r|i|c| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@52
|0+0#e000002&|F@2|H|,+0#e000e06&| +0#0000000&|1+0#e000002&|.|2|3|,+0#e000e06&| +0#0000000&|1+0#e000002&|.|2|3|e|-|4|5|,+0#e000e06&| +0#0000000&|1+0#e000002&|0@2| +0#0000000&@47
@75
|(+0#0000e05&|*| |o|c|t|a|l| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@54
|n| |:+0#e000e06&|=| +0#0000000&|0+0#e000002&|3|7@1|B|;+0#e000e06&| +0#0000000&|c|h| |:+0#e000e06&|=| +0#0000000&|0+0#e000002&|3|7@1|C|;+0#e000e06&| +0#0000000&@50
@75
|(+0#0000e05&|*| |p|r|a|g|m|a|s| |*|)| +0#0000000&@61
@57|3|7|,|1| @9|3@1|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_pim_03.dump
@@ -0,0 +1,20 @@
|(+0#0000e05#ffffff0|*| |p|r|a|g|m|a|s| |*|)| +0#0000000&@61
|(+0#e000e06&|*|$|f|o@1|*|)| +0#0000000&@66
@75
|(+0#0000e05&|*| |b|l|o|c|k| |c|o|m@1|e|n|t|s| |w|i|t|h| |e|m|p|h|a|s|i|s| |*|)| +0#0000000&@40
|(+0#0000e05&|*| |c+0#e000e06&|o|p|y|r|i|g|h|t| +0#0000e05&|(|c|)| |J|u|r@1|a|s|i|c| |I|n|c|.| +0#0000000&@44
| +0#0000e05&@2>a+0#e000e06&|u|t|h|o|r| +0#0000e05&|F|r|e|d| |F|l|i|n|t|s|t|o|n|e| |S|r|.| +0#0000000&@45
| +0#0000e05&@2|l+0#e000e06&|i|c|e|n|s|e| +0#0000e05&|s|e@1| |L|I|C|E|N|S|E| |f|i|l|e|.| |*|)| +0#0000000&@43
@75
|(+0#0000e05&|*| |p+0#e000e06&|r|e|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|f|o@1| |b|a|r| |b|a|z| |b|a|m| |b|o@1| |d|o@1|d|l|e| |w|a|h|.| +0#0000000&@24
| +0#0000e05&@2|p+0#e000e06&|o|s|t|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|f|o@1|d|l|e| |b|a|b@1|l|e| |b|o|z|o| |b|i|m| |b|a|m| |d|a|n|g|.| +0#0000000&@22
| +0#0000e05&@2|e+0#e000e06&|r@1|o|r|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|d|a|d|a| |j|i|n|g|l|e| |j|u|n|g|l|e| |b|o|g@1|l|e| |d|e@1| |b|o@1|.| |*|)| +0#0000000&@16
@75
|(+0#0000e05&|*| |t|e|c|h|n|i|c|a|l| |d|e|b|t| |m|a|r|k|e|r|s| |*|)| +0#0000000&@46
|(+0#0000e05&|*| |T+0#e000e06&|O|D|O|:| +0#0000e05&|.@2| |*|)| +0#0000000&@59
|(+0#0000e05&|*| |F+0#e000e06&|I|X|M|E| +0#0000e05&|*|)| +0#0000000&@63
|(+0#0000e05&|*| |D+0#e000e06&|E|P|R|E|C|A|T|E|D| +0#0000e05&|*|)| +0#0000000&@58
@75
|(+0#0000e05&|*| |p|r|o|c|e|d|u|r|e|s| |*|)| +0#0000000&@58
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|N+0#00e0e07&|e|w|F|o@1|W|i|t|h|B|a|r| +0#0000000&|(+0#e000e06&| +0#0000000&|V+0#af5f00255&|A|R| +0#0000000&|f|o@1|:+0#e000e06&| +0#0000000&|F|o@1|;+0#e000e06&| +0#0000000&|b|a|r| |:+0#e000e06&| +0#0000000&|I|N|T|E|G|E|R| |)+0#e000e06&|;| +0#0000000&@18
@57|5@1|,|4| @9|5|3|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_pim_04.dump
@@ -0,0 +1,20 @@
|P+0#af5f00255#ffffff0|R|O|C|E|D|U|R|E| +0#0000000&|N+0#00e0e07&|e|w|F|o@1|W|i|t|h|B|a|r| +0#0000000&|(+0#e000e06&| +0#0000000&|V+0#af5f00255&|A|R| +0#0000000&|f|o@1|:+0#e000e06&| +0#0000000&|F|o@1|;+0#e000e06&| +0#0000000&|b|a|r| |:+0#e000e06&| +0#0000000&|I|N|T|E|G|E|R| |)+0#e000e06&|;| +0#0000000&@18
|B+0#af5f00255&|E|G|I|N| +0#0000000&@69
@2|N|E|W|(+0#e000e06&|f+0#0000000&|o@1|)+0#e000e06&|;| +0#0000000&@63
@2|f|o@1|^+0#e000e06&|.|b+0#0000000&|a|r| |:+0#e000e06&|=| +0#0000000&|b|a|r|;+0#e000e06&| +0#0000000&@56
@2|R+0#af5f00255&|E|T|U|R|N| +0#0000000&@66
>E+0#af5f00255&|N|D| +0#0000000&|S+0#00e0e07&|e|t|B|a|r|;+0#e000e06&| +0#0000000&@63
@75
|(+0#0000e05&|*| |f|u|n|c|t|i|o|n|s| |*|)| +0#0000000&@59
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|(+0#e000e06&| +0#0000000&|f|o@1| |:+0#e000e06&| +0#0000000&|F|o@1| |)+0#e000e06&| +0#0000000&|:+0#e000e06&| +0#0000000&|I|N|T|E|G|E|R|;+0#e000e06&| +0#0000000&@36
|B+0#af5f00255&|E|G|I|N| +0#0000000&@69
@2|I+0#af5f00255&|F| +0#0000000&|f|o@1| |=+0#e000e06&| +0#0000000&|N|I|L| |T+0#af5f00255&|H|E|N| +0#0000000&@55
@4|H|A|L|T| @66
@2|E+0#af5f00255&|L|S|E| +0#0000000&@68
@4|R+0#af5f00255&|E|T|U|R|N| +0#0000000&|f|o@1|^+0#e000e06&|.|b+0#0000000&|a|r| @55
@2|E+0#af5f00255&|N|D| +0#0000000&|(+0#0000e05&|*| |I|F| |*|)| +0#0000000&@60
|E+0#af5f00255&|N|D| +0#0000000&|b+0#00e0e07&|a|r|;+0#e000e06&| +0#0000000&@66
@75
|(+0#0000e05&|*| |d|i|s|a|b|l|e|d| |c|o|d|e| |*|)| +0#0000000&@55
|?+0#4040ff13&|<| +0#0000000&@72
@57|7|3|,|1| @9|7|2|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_pim_05.dump
@@ -0,0 +1,20 @@
|?+0#4040ff13#ffffff0|<| +0#0000000&@72
|W+0#4040ff13&|H|I|L|E| |f|o@1| |=| |b|a|r| |D|O| +0#0000000&@56
| +0#4040ff13&@1|b|a|z|(|b|a|m|,| |b|o@1|)| +0#0000000&@59
|E+0#4040ff13&|N|D| |(|*| |W|H|I|L|E| |*|)|;| +0#0000000&@58
|>+0#4040ff13&|?| +0#0000000&@72
> @74
|(+0#0000e05&|*| |s|y|n|o|n|y|m|s| |*|)| +0#0000000&@60
|&+0#e000e06&| +0#0000000&@1|~+0#e000e06&| +0#0000000&@70
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |c|h|a|r|a|c|t|e|r|s| |*|)| +0#0000000&@50
|`+0#ffffff16#ff404010| +0#0000000#ffffff0@1|!+0#ffffff16#ff404010| +0#0000000#ffffff0@1|@+0#ffffff16#ff404010| +0#0000000#ffffff0@1|$+0#ffffff16#ff404010| +0#0000000#ffffff0@1|%+0#ffffff16#ff404010| +0#0000000#ffffff0@1|\+0#ffffff16#ff404010| +0#0000000#ffffff0@1|?+0#ffffff16#ff404010| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010| +0#0000000#ffffff0@52
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@49
@75
|_+0#ffffff16#ff404010|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@26
@75
|b+0#ffffff16#ff404010|a|r|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_| +0#0000000#ffffff0@26
@75
|_+0#ffffff16#ff404010@1|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@22
@57|9|1|,|0|-|1| @7|9|2|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_pim_99.dump
@@ -0,0 +1,20 @@
|&+0#e000e06#ffffff0| +0#0000000&@1|~+0#e000e06&| +0#0000000&@70
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |c|h|a|r|a|c|t|e|r|s| |*|)| +0#0000000&@50
|`+0#ffffff16#ff404010| +0#0000000#ffffff0@1|!+0#ffffff16#ff404010| +0#0000000#ffffff0@1|@+0#ffffff16#ff404010| +0#0000000#ffffff0@1|$+0#ffffff16#ff404010| +0#0000000#ffffff0@1|%+0#ffffff16#ff404010| +0#0000000#ffffff0@1|\+0#ffffff16#ff404010| +0#0000000#ffffff0@1|?+0#ffffff16#ff404010| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010| +0#0000000#ffffff0@52
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@49
@75
|_+0#ffffff16#ff404010|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@26
@75
|b+0#ffffff16#ff404010|a|r|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_| +0#0000000#ffffff0@26
@75
|_+0#ffffff16#ff404010@1|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_@1|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1| +0#0000000#ffffff0@35
@75
@75
>E+0#af5f00255&|N|D| +0#0000000&|F+0#00e0e07&|o@1|b|a|r|.+0#e000e06&| +0#0000000&@63
@57|1@2|,|1| @8|B|o|t|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_00.dump
@@ -0,0 +1,20 @@
>(+0#0000e05#ffffff0|*| |M|o|d|u|l|a|-|2| |R|1|0| |T|e|s|t| |F|i|l|e| |f|o|r| |V|i|m| |S|y|n|t|a|x| |C|o|l|o|u|r|i|n|g| |*|)| +0#0000000&@21
@75
|(+0#0000e05&|*| |-@49| +0#0000000&@21
| +0#0000e05&|*| |T|H|I|S| |F|I|L|E| |I|S| |L|I|C|E|N|S|E|D| |U|N|D|E|R| |T|H|E| |V|I|M| |L|I|C|E|N|S|E| +0#0000000&@28
| +0#0000e05&|*| |s|e@1| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|b|l|o|b|/|m|a|s|t|e|r|/|L|I|C|E|N|S|E| +0#0000000&@21
| +0#0000e05&|*| |-@49| |*|)| +0#0000000&@18
@75
|D+0#af5f00255&|E|F|I|N|I|T|I|O|N| +0#0000000&|M+0#af5f00255&|O|D|U|L|E| +0#00e0e07&|F|o@1|b|a|r|;+0#e000e06&| +0#0000000&|(+0#e000e06&|*|!|m|2|r|1|0|*|)| +0#0000000&@38
@75
|I+0#af5f00255&|M|P|O|R|T| +0#0000000&|U+0#00e0003&|N|S|A|F|E| +0#0000000&|A+0#af5f00255&|L|I|A|S| +0#0000000&|B+0#00e0003&|Y|T|E|,+0#e000e06&| +0#0000000&|W+0#00e0003&|O|R|D|,+0#e000e06&| +0#0000000&|A|D@1|R|E|S@1|;+0#e000e06&| +0#0000000&@34
@75
|C+0#af5f00255&|O|N|S|T| +0#0000000&|M|a|x|F|o@1| |=+0#e000e06&| +0#0000000&|1+0#e000002&|.|0|;+0#e000e06&| +0#0000000&@55
@75
|T+0#af5f00255&|Y|P|E| +0#0000000&|F|o@1| |=+0#e000e06&| +0#0000000&|A+0#af5f00255&|L|I|A|S| +0#0000000&|O+0#af5f00255&|F| +0#0000000&|B|a|r|;+0#e000e06&| +0#0000000&@50
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |c|o|n|s|t|a|n|t|s| |*|)| +0#0000000&@48
|N+0#e000002&|I|L| +0#0000000&|F+0#e000002&|A|L|S|E| +0#0000000&|T+0#e000002&|R|U|E| +0#0000000&@60
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |t|y|p|e|s| |*|)| +0#0000000&@52
|"|i|n|p|u|t|/|m|o|d|u|l|a|2|_|r|1|0|.|d|e|f|"| |1|4|6|L|,| |2|9|8|3|B| @21|1|,|1| @10|T|o|p|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_01.dump
@@ -0,0 +1,20 @@
|T+0#af5f00255#ffffff0|Y|P|E| +0#0000000&|F|o@1| |=+0#e000e06&| +0#0000000&|A+0#af5f00255&|L|I|A|S| +0#0000000&|O+0#af5f00255&|F| +0#0000000&|B|a|r|;+0#e000e06&| +0#0000000&@50
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |c|o|n|s|t|a|n|t|s| |*|)| +0#0000000&@48
|N+0#e000002&|I|L| +0#0000000&|F+0#e000002&|A|L|S|E| +0#0000000&|T+0#e000002&|R|U|E| +0#0000000&@60
@75
>(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |t|y|p|e|s| |*|)| +0#0000000&@52
|B+0#00e0003&|O@1|L|E|A|N| +0#0000000&|C+0#00e0003&|H|A|R| +0#0000000&|U+0#00e0003&|N|I|C|H|A|R| +0#0000000&|O+0#00e0003&|C|T|E|T| +0#0000000&|C+0#00e0003&|A|R|D|I|N|A|L| +0#0000000&|L+0#00e0003&|O|N|G|C|A|R|D| +0#0000000&|I+0#00e0003&|N|T|E|G|E|R| +0#0000000&|L+0#00e0003&|O|N|G|I|N|T| +0#0000000&|R+0#00e0003&|E|A|L| +0#0000000&|L+0#00e0003&|O|N|G|R|E|A|L| +0#0000000&
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |p|r|o|c|e|d|u|r|e|s| |*|)| +0#0000000&@47
|A+0#00e0e07&|P@1|E|N|D| +0#0000000&|I+0#00e0e07&|N|S|E|R|T| +0#0000000&|R+0#00e0e07&|E|M|O|V|E| +0#0000000&|S+0#00e0e07&|O|R|T| +0#0000000&|S+0#00e0e07&|O|R|T|N|E|W| +0#0000000&@41
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |f|u|n|c|t|i|o|n|s| |*|)| +0#0000000&@48
|C+0#00e0e07&|H|R| +0#0000000&|O+0#00e0e07&|R|D| +0#0000000&|O+0#00e0e07&|D@1| +0#0000000&|A+0#00e0e07&|B|S| +0#0000000&|S+0#00e0e07&|G|N| +0#0000000&|M+0#00e0e07&|I|N| +0#0000000&|M+0#00e0e07&|A|X| +0#0000000&|L+0#00e0e07&|O|G|2| +0#0000000&|P+0#00e0e07&|O|W|2| +0#0000000&|E+0#00e0e07&|N|T|I|E|R| +0#0000000&|P+0#00e0e07&|R|E|D| +0#0000000&|S+0#00e0e07&|U|C@1| +0#0000000&|P+0#00e0e07&|T|R| +0#0000000&|C+0#af5f00255&|A|P|A|C|I|T|Y| +0#0000000&|C+0#00e0e07&|O|U|N|T| +0#0000000&|L+0#00e0e07&
|E|N|G|T|H| +0#0000000&@69
@75
|(+0#0000e05&|*| |p|r|e|d|e|f|i|n|e|d| |m|a|c|r|o|s| |*|)| +0#0000000&@51
|N+0#00e0e07&|O|P| +0#0000000&|T+0#00e0e07&|M|I|N| +0#0000000&|T+0#00e0e07&|M|A|X| +0#0000000&|T+0#00e0e07&|S|I|Z|E| +0#0000000&|T+0#00e0e07&|L|I|M|I|T| +0#0000000&@48
@75
|(+0#0000e05&|*| |u|n|s|a|f|e| |b|u|i|l|t|i|n|s| |*|)| +0#0000000&@53
@57|1|9|,|1| @9|1|0|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_02.dump
@@ -0,0 +1,20 @@
|U+0#00e0003#ffffff0|N|S|A|F|E| +0#0000000&@68
@75
|(+0#0000e05&|*| |u|n|s|a|f|e| |b|u|i|l|t|i|n| |t|y|p|e|s| |*|)| +0#0000000&@48
|B+0#00e0003&|Y|T|E| +0#0000000&|W+0#00e0003&|O|R|D| +0#0000000&|L+0#00e0003&|O|N|G|W|O|R|D| +0#0000000&|A|D@1|R|E|S@1| |O+0#00e0003&|C|T|E|T|S|E|Q| +0#0000000&@39
@75
>(+0#0000e05&|*| |u|n|s|a|f|e| |b|u|i|l|t|i|n| |p|r|o|c|e|d|u|r|e|s| |*|)| +0#0000000&@43
|A+0#00e0003&|D@1| +0#0000000&|S+0#00e0003&|U|B| +0#0000000&|D+0#00e0003&|E|C| +0#0000000&|I+0#00e0003&|N|C| +0#0000000&|S+0#00e0003&|E|T|B|I|T| +0#0000000&|H+0#00e0003&|A|L|T| +0#0000000&@47
@75
|(+0#0000e05&|*| |u|n|s|a|f|e| |b|u|i|l|t|i|n| |f|u|n|c|t|i|o|n|s| |*|)| +0#0000000&@44
|A+0#00e0003&|D|R| +0#0000000&|C+0#00e0003&|A|S|T| +0#0000000&|B+0#00e0003&|I|T| +0#0000000&|S+0#00e0003&|H|L| +0#0000000&|S+0#00e0003&|H|R| +0#0000000&|B+0#00e0003&|W|N|O|T| +0#0000000&|B+0#00e0003&|W|A|N|D| +0#0000000&|B+0#00e0003&|W|O|R| +0#0000000&@37
@75
|(+0#0000e05&|*| |n|o|n|-|p|o|r|t|a|b|l|e| |l|a|n|g|u|a|g|e| |e|x|t|e|n|s|i|o|n|s| |*|)| +0#0000000&@36
|A+0#00e0003&|S@1|E|M|B|L|E|R| +0#0000000&|A+0#00e0003&|S|M| +0#0000000&|R+0#00e0003&|E|G| +0#0000000&@57
@75
|(+0#0000e05&|*| |u|s|e|r| |d|e|f|i|n|e|d| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@44
|f|o@1|b|a|r| |F|o@1|b|a|r| |F|o@1|B|a|r| |f|o@1|_|b|a|r| |f|o@1|0| @41
@75
@75
|(+0#0000e05&|*| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@53
@57|3|7|,|1| @9|2|4|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_03.dump
@@ -0,0 +1,20 @@
|(+0#0000e05#ffffff0|*| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@53
|s|t|r| |:+0#e000e06&|=| +0#0000000&|"+0#e000002&|f|o@1| |'|b|a|r|'| |b|a|z|"|;+0#e000e06&| +0#0000000&@51
|s|t|r| |:+0#e000e06&|=| +0#0000000&|'+0#e000002&|f|o@1| |"|b|a|r|"| |b|a|z|'|;+0#e000e06&| +0#0000000&@51
@75
|(+0#0000e05&|*| |n|u|m|e|r|i|c| |l|i|t|e|r|a|l|s| |*|)| +0#0000000&@52
>0+0#e000002&|b|0|1@1|0|'|0@1|1@1|'|0|1@1|0|'|0@3|,+0#e000e06&| +0#0000000&|0+0#e000002&|u|0|A|,+0#e000e06&| +0#0000000&|0+0#e000002&|x|0|1|2|3|,+0#e000e06&| +0#0000000&|0+0#e000002&|x|C|A|F|E|'|D|0@1|D| +0#0000000&@26
|1+0#e000002&|'|0@2|'|0@2|.|0@1|,+0#e000e06&| +0#0000000&|1+0#e000002&|.|2|3|,+0#e000e06&| +0#0000000&|1+0#e000002&|.|2|3|e|+|1|0|,+0#e000e06&| +0#0000000&|1+0#e000002&|.|2|3|4|'|5|6|7|'|8|9|0|e|-|1|'|0@2| +0#0000000&@24
@75
@75
|(+0#0000e05&|*| |l|a|n|g|u|a|g|e| |d|e|f|i|n|e|d| |p|r|a|g|m|a|s| |*|)| +0#0000000&@44
|<+0#e000e06&|*|M|S|G|=|I|N|F|O|:|"|f|o@1|b|a|r|"|*|>| +0#0000000&|<+0#e000e06&|*|E|N|C|O|D|I|N|G|=|"|U|T|F|8|"|*|>| +0#0000000&|<+0#e000e06&|*|I|N|L|I|N|E|*|>| +0#0000000&|<+0#e000e06&|*|N|O|I|N|L|I|N|E|*|>| +0#0000000&|<+0#e000e06&|*|F@1|I|=|"|C|"
|*|>| +0#0000000&@72
@75
|(+0#0000e05&|*| |i|m|p|l|e|m|e|n|t|a|t|i|o|n| |d|e|f|i|n|e|d| |p|r|a|g|m|a|s| |*|)| +0#0000000&@38
|<+0#e000e06&|*|G|M|2|.|F|o@1|b|a|r|||W|=|B|a|z|b|a|m|*|>| +0#0000000&@51
@75
@75
|(+0#0000e05&|*| |s|i|n|g|l|e| |l|i|n|e| |c|o|m@1|e|n|t| |*|)| +0#0000000&@49
|!+0#0000e05&| |f|o@1| |b|a|r| |b|a|z| |b|a|m| |b|o@1| | +0#0000000&@52
@57|5@1|,|1| @9|3|8|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_04.dump
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|(+0#0000e05&|*| |b|l|o|c|k| |c|o|m@1|e|n|t|s| |w|i|t|h| |e|m|p|h|a|s|i|s| |*|)| +0#0000000&@40
|(+0#0000e05&|*| |c+0#e000e06&|o|p|y|r|i|g|h|t| +0#0000e05&|(|c|)| |2|0|1|6| |M|o|d|u|l|a|-|2| |F|o|u|n|d|a|t|i|o|n|.| +0#0000000&@32
| +0#0000e05&@2|a+0#e000e06&|u|t|h|o|r|s| +0#0000e05&|B|.|K|o|w|a|r|s|c|h| |a|n|d| |R|.|S|u|t|c|l|i|f@1|e| +0#0000000&@37
| +0#0000e05&@2|l+0#e000e06&|i|c|e|n|s|e| +0#0000e05&|s|e@1| |L|I|C|E|N|S|E| |*|)| +0#0000000&@49
> @74
|(+0#0000e05&|*| |p+0#e000e06&|r|e|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|f|o@1| |b|a|r| |b|a|z| |b|a|m| |b|o@1| |d|o@1|d|l|e| |w|a|h|.| +0#0000000&@24
| +0#0000e05&@2|p+0#e000e06&|o|s|t|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|f|o@1|d|l|e| |b|a|b@1|l|e| |b|o|z|o| |b|i|m| |b|a|m| |d|a|n|g|.| +0#0000000&@22
| +0#0000e05&@2|e+0#e000e06&|r@1|o|r|-|c|o|n|d|i|t|i|o|n|s|:| +0#0000e05&|d|a|d|a| |j|i|n|g|l|e| |j|u|n|g|l|e| |b|o|g@1|l|e| |d|e@1| |b|o@1|.| |*|)| +0#0000000&@16
@75
|(+0#0000e05&|*| |(|*| |*|)| |*|)| +0#0000000&@63
@75
|(+0#0000e05&|*| |b|i|n|d|i|n|g|s| |*|)| +0#0000000&@60
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|[+0#e000e06&|+|]| +0#0000000&|s+0#00e0e07&|u|m| +0#0000000&|(+0#e000e06&| +0#0000000&|a|,+0#e000e06&| +0#0000000&|b| |:+0#e000e06&| +0#0000000&|B|C|D| |)+0#e000e06&| +0#0000000&|:+0#e000e06&| +0#0000000&|B|C|D|;+0#e000e06&| +0#0000000&@35
@75
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|[+0#e000e06&|M+0#af5f00255&|O|D|]+0#e000e06&| +0#0000000&|m+0#00e0e07&|o|d|u|l|u|s| +0#0000000&|(+0#e000e06&| +0#0000000&|n|,+0#e000e06&| +0#0000000&|m| |:+0#e000e06&| +0#0000000&|I|N|T|6|4| |)+0#e000e06&| +0#0000000&|:+0#e000e06&| +0#0000000&|I|N|T|6|4|;+0#e000e06&| +0#0000000&@25
@75
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|[+0#e000e06&|R+0#af5f00255&|E|T|A|I|N|]+0#e000e06&| +0#0000000&|R+0#00e0e07&|e|t|a|i|n| +0#0000000&|(+0#e000e06&| +0#0000000&|f|o@1| |:+0#e000e06&| +0#0000000&|F|o@1| |)+0#e000e06&|;| +0#0000000&@34
@75
@57|7|3|,|0|-|1| @7|5|2|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_05.dump
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|[+0#e000e06&|L+0#00e0e07&|E|N|G|T|H|]+0#e000e06&| +0#0000000&|l+0#00e0e07&|e|n|g|t|h| +0#0000000&|(+0#e000e06&| +0#0000000&|s|t|r| |:+0#e000e06&| +0#0000000&|S|t|r|i|n|g| |)+0#e000e06&| +0#0000000&|:+0#e000e06&| +0#0000000&|L+0#00e0003&|O|N|G|C|A|R|D|;+0#e000e06&| +0#0000000&@20
@75
@75
|(+0#0000e05&|*| |p|r|o|c|e|d|u|r|e|s| |*|)| +0#0000000&@58
>P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|N+0#00e0e07&|e|w|F|o@1|W|i|t|h|B|a|r| +0#0000000&|(+0#e000e06&| +0#0000000&|V+0#af5f00255&|A|R| +0#0000000&|f|o@1|:+0#e000e06&| +0#0000000&|F|o@1|;+0#e000e06&| +0#0000000&|b|a|r| |:+0#e000e06&| +0#0000000&|I+0#00e0003&|N|T|E|G|E|R| +0#0000000&|)+0#e000e06&|;| +0#0000000&@18
|B+0#af5f00255&|E|G|I|N| +0#0000000&@69
@2|N+0#af5f00255&|E|W|(+0#e000e06&|f+0#0000000&|o@1|)+0#e000e06&|;| +0#0000000&@63
@2|f|o@1|^+0#e000e06&|.|b+0#0000000&|a|r| |:+0#e000e06&|=| +0#0000000&|b|a|r|;+0#e000e06&| +0#0000000&@56
@2|R+0#af5f00255&|E|T|U|R|N| +0#0000000&@66
|E+0#af5f00255&|N|D| +0#0000000&|N+0#00e0e07&|e|w|F|o@1|W|i|t|h|B|a|r|;+0#e000e06&| +0#0000000&@56
@75
|E+0#af5f00255&|N|D| +0#0000000&|E+0#af5f00255&|N|D|;+0#e000e06&| +0#0000000&@66
@75
|(+0#0000e05&|*| |f|u|n|c|t|i|o|n|s| |*|)| +0#0000000&@59
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|(+0#e000e06&| +0#0000000&|f|o@1| |:+0#e000e06&| +0#0000000&|F|o@1| |)+0#e000e06&| +0#0000000&|:+0#e000e06&| +0#0000000&|I+0#00e0003&|N|T|E|G|E|R|;+0#e000e06&| +0#0000000&@36
|B+0#af5f00255&|E|G|I|N| +0#0000000&@69
@2|I+0#af5f00255&|F| +0#0000000&|f|o@1| |=+0#e000e06&| +0#0000000&|N+0#e000002&|I|L| +0#0000000&|T+0#af5f00255&|H|E|N| +0#0000000&@55
@4|U+0#00e0003&|N|S|A|F|E|.+0#e000e06&|H+0#00e0003&|A|L|T| +0#0000000&@59
@57|9|1|,|1| @9|6@1|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_06.dump
@@ -0,0 +1,20 @@
| +0&#ffffff0@3|U+0#00e0003&|N|S|A|F|E|.+0#e000e06&|H+0#00e0003&|A|L|T| +0#0000000&@59
@2|E+0#af5f00255&|L|S|E| +0#0000000&@68
@4|R+0#af5f00255&|E|T|U|R|N| +0#0000000&|f|o@1|^+0#e000e06&|.|b+0#0000000&|a|r| @55
@2|E+0#af5f00255&|N|D| +0#0000000&|(+0#0000e05&|*| |I|F| |*|)| +0#0000000&@60
|E+0#af5f00255&|N|D| +0#0000000&|b+0#00e0e07&|a|r|;+0#e000e06&| +0#0000000&@66
> @74
@75
|(+0#0000e05&|*| |t|e|c|h|n|i|c|a|l| |d|e|b|t| |*|)| +0#0000000&@54
|T+0#af5f00255&|O| +0#0000000&|D+0#af5f00255&|O| +0#0000000&|(+0#e000e06&| +0#0000000&|1+0#e000002&|2|3|4|,+0#e000e06&| +0#0000000&|W|e|i|g|h|t|.+0#e000e06&|M+0#0000000&|a|j|o|r| |)+0#e000e06&| +0#0000000&|(+0#0000e05&|*| |f|o@1| |*|)| +0#0000000&@36
@2|"+0#e000002&|r|e|d|e|s|i|g|n| |f|o@1|"|,+0#e000e06&| +0#0000000&|2+0#e000002&|d+0#0000000&|;+0#e000e06&| +0#0000000&@53
@2|"+0#e000002&|r|e|p|l|a|c|e| |f|o@1|"|,+0#e000e06&| +0#0000000&|2+0#e000002&|d+0#0000000&|;+0#e000e06&| +0#0000000&@54
@2|"+0#e000002&|t|e|s|t| |n|e|w| |f|o@1|"|,+0#e000e06&| +0#0000000&|1+0#e000002&|d+0#0000000&| @54
|E+0#e000e06&|N|D| +0#0000000&|(+0#0000e05&|*| |T|O| |D|O| |*|)|;+0#e000e06&| +0#0000000&@58
@75
|P+0#af5f00255&|R|O|C|E|D|U|R|E| +0#0000000&|S+0#00e0e07&|e|t|B|a|b|a| +0#0000000&|<+0#e000e06&|*|D|E|P|R|E|C|A|T|E|D|*|>| +0#0000000&|(+0#e000e06&| +0#0000000&|n| |:+0#e000e06&| +0#0000000&|C+0#00e0003&|A|R|D|I|N|A|L| +0#0000000&|)+0#e000e06&|;| +0#0000000&@24
@75
@75
|(+0#0000e05&|*| |d|i|s|a|b|l|e|d| |c|o|d|e| |*|)| +0#0000000&@55
|?+0#4040ff13&|<| +0#0000000&@72
@57|1|0|9|,|0|-|1| @6|8|1|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_07.dump
@@ -0,0 +1,20 @@
|?+0#4040ff13#ffffff0|<| +0#0000000&@72
|W+0#4040ff13&|H|I|L|E| |f|o@1| |=| |b|a|r| |D|O| +0#0000000&@56
| +0#4040ff13&@1|b|a|z|(|b|a|m|,| |b|o@1|)| +0#0000000&@59
|E+0#4040ff13&|N|D| |(|*| |W|H|I|L|E| |*|)|;| +0#0000000&@58
|>+0#4040ff13&|?| +0#0000000&@72
> @74
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |c|h|a|r|a|c|t|e|r|s| |*|)| +0#0000000&@50
|`+0#ffffff16#ff404010| +0#0000000#ffffff0@1|~+0#ffffff16#ff404010| +0#0000000#ffffff0@1|$+0#ffffff16#ff404010| +0#0000000#ffffff0@1|%+0#ffffff16#ff404010| +0#0000000#ffffff0@1|?+0#ffffff16#ff404010| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010| +0#0000000#ffffff0@58
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@49
@75
|_+0#ffffff16#ff404010|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@26
@75
|b+0#ffffff16#ff404010|a|r|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_| +0#0000000#ffffff0@26
@75
|_+0#ffffff16#ff404010@1|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_@1| +0#0000000#ffffff0@22
@57|1|2|7|,|0|-|1| @6|9|5|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/modula2_r10_99.dump
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |c|h|a|r|a|c|t|e|r|s| |*|)| +0#0000000&@50
|`+0#ffffff16#ff404010| +0#0000000#ffffff0@1|~+0#ffffff16#ff404010| +0#0000000#ffffff0@1|$+0#ffffff16#ff404010| +0#0000000#ffffff0@1|%+0#ffffff16#ff404010| +0#0000000#ffffff0@1|?+0#ffffff16#ff404010| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010| +0#0000000#ffffff0@58
@75
|(+0#0000e05&|*| |i|l@1|e|g|a|l| |i|d|e|n|t|i|f|i|e|r|s| |*|)| +0#0000000&@49
@75
|_+0#ffffff16#ff404010|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@26
@75
|b+0#ffffff16#ff404010|a|r|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_| +0#0000000#ffffff0@26
@75
|_+0#ffffff16#ff404010@1|b|a|r| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_@1| +0#0000000#ffffff0@1|b+0#ffffff16#ff404010|a|r|_|b|a|z|_@1|b|a|m|_|b|o@1|_@1| +0#0000000#ffffff0@22
@75
|b+0#ffffff16#ff404010|a|r|_@1|b|a|z| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1|b|a|r|_@1|b|a|z|_@1| +0#0000000#ffffff0@1|_+0#ffffff16#ff404010@1| +0#0000000#ffffff0@35
@75
@75
|(+0#0000e05&|*| |m|o|d|u|l|e| |e|n|d| |*|)| +0#0000000&@58
>E+0#af5f00255&|N|D| +0#0000000&|F+0#00e0e07&|o@1|b|a|r|.+0#e000e06&| +0#0000000&@63
@57|1|4|6|,|1| @8|B|o|t|
114 changes: 114 additions & 0 deletions runtime/syntax/testdir/input/modula2_iso.def
@@ -0,0 +1,114 @@
(* Modula-2 ISO Test File for Vim Syntax Colouring *)

(* --------------------------------------------------
* THIS FILE IS LICENSED UNDER THE VIM LICENSE
* see https://github.com/vim/vim/blob/master/LICENSE
* -------------------------------------------------- *)


DEFINITION MODULE Foobar; (*!m2iso*)

FROM SYSTEM IMPORT LOC, WORD, ADDRESS;

CONST MaxFoo = 1.0; LF = CHR(10);

TYPE Foo = POINTER TO Bar;

(* predefined constants *)
FALSE NIL TRUE INTERRUPTIBLE UNINTERRUPTIBLE

(* predefined types *)
BITSET BOOLEAN CHAR PROC CARDINAL INTEGER LONGINT REAL LONGREAL
COMPLEX LONGCOMPLEX PROTECTION

(* predefined procedures *)
CAP DEC EXCL HALT INC INCL

(* predefined functions *)
ABS CHR CMPLX FLOAT HIGH IM INT LENGTH LFLOAT MAX MIN ODD ORD RE SIZE TRUNC VAL

(* predefined macros *)
NEW DISPOSE

(* unsafe builtins *)
ADDRESS BYTE LOC WORD ADR CAST TSIZE SYSTEM
MAKEADR ADDADR SUBADR DIFADR ROTATE SHIFT

(* non-standard language extensions *)
LONGCARD LONGBITSET

(* user defined identifiers *)
foobar Foobar FooBar foo123 foo_bar

(* string literals *)
str := "foo 'bar' baz";
str := 'foo "bar" baz';

(* numeric literals *)
0FFFH, 1.23, 1.23e-45, 1000

(* octal literals *)
n := 0377B; ch := 0377C;

(* pragmas *)
<*$foo*>

(* block comments with emphasis *)
(* copyright (c) Jurrasic Inc.
author Fred Flintstone Sr.
license see LICENSE file. *)

(* pre-conditions: foo bar baz bam boo doodle wah.
post-conditions: foodle babble bozo bim bam dang.
error-conditions: dada jingle jungle boggle dee boo. *)

(* technical debt markers *)
(* TODO: ... *)
(* FIXME *)
(* DEPRECATED *)

(* procedures *)
PROCEDURE NewFooWithBar ( VAR foo: Foo; bar : INTEGER );
BEGIN
NEW(foo);
foo^.bar := bar;
RETURN
END SetBar;

(* functions *)
PROCEDURE bar ( foo : Foo ) : INTEGER;
BEGIN
IF foo = NIL THEN
HALT
ELSE
RETURN foo^.bar
END (* IF *)
END bar;

(* disabled code *)
?<
WHILE foo = bar DO
baz(bam, boo)
END (* WHILE *);
>?

(* synonyms *)
@ & ~

(* illegal characters *)
` ! $ % \ ? _

(* illegal identifiers *)

_bar _bar_baz _bar_baz__bam _bar_baz__bam_boo

bar_ bar_baz_ bar_baz__bam_ bar_baz__bam_boo_

__bar __bar_baz __bar_baz__bam __bar_baz__bam_boo

bar__ bar_baz__ bar_baz__bam__ bar_baz__bam_boo__

bar__baz __bar_baz__ __bar__baz__ __


END Foobar.
111 changes: 111 additions & 0 deletions runtime/syntax/testdir/input/modula2_pim.def
@@ -0,0 +1,111 @@
(* Modula-2 PIM Test File for Vim Syntax Colouring *)

(* --------------------------------------------------
* THIS FILE IS LICENSED UNDER THE VIM LICENSE
* see https://github.com/vim/vim/blob/master/LICENSE
* -------------------------------------------------- *)

DEFINITION MODULE Foobar; (*!m2pim*)

FROM SYSTEM IMPORT WORD, ADDRESS;

CONST MaxFoo = 1.0; LF = CHR(10);

TYPE Foo = POINTER TO Bar;

(* predefined constants *)
FALSE NIL TRUE

(* predefined types *)
BITSET BOOLEAN CHAR PROC CARDINAL INTEGER LONGINT REAL LONGREAL

(* predefined procedures *)
CAP DEC EXCL HALT INC INCL

(* predefined functions *)
ABS CHR FLOAT HIGH MAX MIN ODD ORD SIZE TRUNC VAL

(* predefined macros *)
NEW DISPOSE

(* unsafe builtins *)
ADDRESS PROCESS WORD ADR TSIZE NEWPROCESS TRANSFER SYSTEM

(* non-standard language extensions *)
BYTE LONGCARD LONGBITSET

(* user defined identifiers *)
foobar Foobar FooBar foo123 foo_bar

(* string literals *)
str := "foo 'bar' baz";
str := 'foo "bar" baz';

(* numeric literals *)
0FFFH, 1.23, 1.23e-45, 1000

(* octal literals *)
n := 0377B; ch := 0377C;

(* pragmas *)
(*$foo*)

(* block comments with emphasis *)
(* copyright (c) Jurrasic Inc.
author Fred Flintstone Sr.
license see LICENSE file. *)

(* pre-conditions: foo bar baz bam boo doodle wah.
post-conditions: foodle babble bozo bim bam dang.
error-conditions: dada jingle jungle boggle dee boo. *)

(* technical debt markers *)
(* TODO: ... *)
(* FIXME *)
(* DEPRECATED *)

(* procedures *)
PROCEDURE NewFooWithBar ( VAR foo: Foo; bar : INTEGER );
BEGIN
NEW(foo);
foo^.bar := bar;
RETURN
END SetBar;

(* functions *)
PROCEDURE bar ( foo : Foo ) : INTEGER;
BEGIN
IF foo = NIL THEN
HALT
ELSE
RETURN foo^.bar
END (* IF *)
END bar;

(* disabled code *)
?<
WHILE foo = bar DO
baz(bam, boo)
END (* WHILE *);
>?

(* synonyms *)
& ~

(* illegal characters *)
` ! @ $ % \ ? _

(* illegal identifiers *)

_bar _bar_baz _bar_baz__bam _bar_baz__bam_boo

bar_ bar_baz_ bar_baz__bam_ bar_baz__bam_boo_

__bar __bar_baz __bar_baz__bam __bar_baz__bam_boo

bar__ bar_baz__ bar_baz__bam__ bar_baz__bam_boo__

bar__baz __bar_baz__ __bar__baz__ __


END Foobar.
146 changes: 146 additions & 0 deletions runtime/syntax/testdir/input/modula2_r10.def
@@ -0,0 +1,146 @@
(* Modula-2 R10 Test File for Vim Syntax Colouring *)

(* --------------------------------------------------
* THIS FILE IS LICENSED UNDER THE VIM LICENSE
* see https://github.com/vim/vim/blob/master/LICENSE
* -------------------------------------------------- *)

DEFINITION MODULE Foobar; (*!m2r10*)

IMPORT UNSAFE ALIAS BYTE, WORD, ADDRESS;

CONST MaxFoo = 1.0;

TYPE Foo = ALIAS OF Bar;

(* predefined constants *)
NIL FALSE TRUE

(* predefined types *)
BOOLEAN CHAR UNICHAR OCTET CARDINAL LONGCARD INTEGER LONGINT REAL LONGREAL

(* predefined procedures *)
APPEND INSERT REMOVE SORT SORTNEW

(* predefined functions *)
CHR ORD ODD ABS SGN MIN MAX LOG2 POW2 ENTIER PRED SUCC PTR CAPACITY COUNT LENGTH

(* predefined macros *)
NOP TMIN TMAX TSIZE TLIMIT

(* unsafe builtins *)
UNSAFE

(* unsafe builtin types *)
BYTE WORD LONGWORD ADDRESS OCTETSEQ

(* unsafe builtin procedures *)
ADD SUB DEC INC SETBIT HALT

(* unsafe builtin functions *)
ADR CAST BIT SHL SHR BWNOT BWAND BWOR

(* non-portable language extensions *)
ASSEMBLER ASM REG

(* user defined identifiers *)
foobar Foobar FooBar foo_bar foo0


(* string literals *)
str := "foo 'bar' baz";
str := 'foo "bar" baz';

(* numeric literals *)
0b0110'0011'0110'0000, 0u0A, 0x0123, 0xCAFE'D00D
1'000'000.00, 1.23, 1.23e+10, 1.234'567'890e-1'000


(* language defined pragmas *)
<*MSG=INFO:"foobar"*> <*ENCODING="UTF8"*> <*INLINE*> <*NOINLINE*> <*FFI="C"*>

(* implementation defined pragmas *)
<*GM2.Foobar|W=Bazbam*>


(* single line comment *)
! foo bar baz bam boo

(* block comments with emphasis *)
(* copyright (c) 2016 Modula-2 Foundation.
authors B.Kowarsch and R.Sutcliffe
license see LICENSE *)

(* pre-conditions: foo bar baz bam boo doodle wah.
post-conditions: foodle babble bozo bim bam dang.
error-conditions: dada jingle jungle boggle dee boo. *)

(* (* *) *)

(* bindings *)
PROCEDURE [+] sum ( a, b : BCD ) : BCD;

PROCEDURE [MOD] modulus ( n, m : INT64 ) : INT64;

PROCEDURE [RETAIN] Retain ( foo : Foo );

PROCEDURE [LENGTH] length ( str : String ) : LONGCARD;


(* procedures *)
PROCEDURE NewFooWithBar ( VAR foo: Foo; bar : INTEGER );
BEGIN
NEW(foo);
foo^.bar := bar;
RETURN
END NewFooWithBar;

END END;

(* functions *)
PROCEDURE bar ( foo : Foo ) : INTEGER;
BEGIN
IF foo = NIL THEN
UNSAFE.HALT
ELSE
RETURN foo^.bar
END (* IF *)
END bar;


(* technical debt *)
TO DO ( 1234, Weight.Major ) (* foo *)
"redesign foo", 2d;
"replace foo", 2d;
"test new foo", 1d
END (* TO DO *);

PROCEDURE SetBaba <*DEPRECATED*> ( n : CARDINAL );


(* disabled code *)
?<
WHILE foo = bar DO
baz(bam, boo)
END (* WHILE *);
>?


(* illegal characters *)
` ~ $ % ? _

(* illegal identifiers *)

_bar _bar_baz _bar_baz__bam _bar_baz__bam_boo

bar_ bar_baz_ bar_baz__bam_ bar_baz__bam_boo_

__bar __bar_baz __bar_baz__bam __bar_baz__bam_boo

bar__ bar_baz__ bar_baz__bam__ bar_baz__bam_boo__

bar__baz __bar_baz__ __bar__baz__ __


(* module end *)
END Foobar.
8 changes: 7 additions & 1 deletion src/Makefile
Expand Up @@ -2338,7 +2338,8 @@ installruntime: installrtbase installmacros installpack installtutor installspel
# Also install most of the other runtime files.
installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(VIMTARGET) $(DEST_RT) \
$(DEST_HELP) $(DEST_PRINT) $(DEST_COL) \
$(DEST_SYN) $(DEST_SYN)/shared $(DEST_IND) $(DEST_FTP) \
$(DEST_SYN) $(DEST_SYN)/modula2 $(DEST_SYN)/modula2/opt $(DEST_SYN)/shared \
$(DEST_IND) $(DEST_FTP) \
$(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig \
$(DEST_IMPORT) $(DEST_IMPORT)/dist \
$(DEST_PLUG) $(DEST_TUTOR) $(DEST_SPELL) $(DEST_COMP)
Expand Down Expand Up @@ -2413,6 +2414,8 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(VIMTARGET) $(DEST_RT) \
cd $(DEST_SYN); chmod $(HELPMOD) *.vim README.txt
cd $(SYNSOURCE)/shared; $(INSTALL_DATA) *.vim README.txt $(DEST_SYN)/shared
cd $(DEST_SYN)/shared; chmod $(HELPMOD) *.vim README.txt
cd $(SYNSOURCE)/modula2/opt; $(INSTALL_DATA) *.vim $(DEST_SYN)/modula2/opt
cd $(DEST_SYN)/modula2/opt; chmod $(HELPMOD) *.vim
# install the indent files
cd $(INDSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_IND)
cd $(DEST_IND); chmod $(HELPMOD) *.vim README.txt
Expand Down Expand Up @@ -2661,6 +2664,7 @@ $(HELPSOURCE)/vim.1 $(MACROSOURCE) $(TOOLSSOURCE):
$(DESTDIR)$(exec_prefix) $(DEST_BIN) \
$(DEST_VIM) $(DEST_RT) $(DEST_HELP) \
$(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_SYN)/shared \
$(DEST_SYN)/modula2 $(DEST_SYN)/modula2/opt \
$(DEST_IND) $(DEST_FTP) \
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \
$(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
Expand Down Expand Up @@ -2838,6 +2842,7 @@ uninstall_runtime:
-rm -rf $(DEST_COL)/tools
-rm -rf $(DEST_COL)/lists
-rm -f $(DEST_SYN)/shared/*.vim $(DEST_SYN)/shared/README.txt
-rm -f $(DEST_SYN)/modula2/opt/*.vim
-rm -f $(DEST_SYN)/*.vim $(DEST_SYN)/README.txt
-rm -f $(DEST_IND)/*.vim $(DEST_IND)/README.txt
-rm -rf $(DEST_MACRO)
Expand All @@ -2850,6 +2855,7 @@ uninstall_runtime:
-rm -rf $(DEST_COMP)
-rm -f $(DEST_PRINT)/*.ps
-rmdir $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN)/shared
-rmdir $(DEST_SYN)/modula2/opt $(DEST_SYN)/modula2
-rmdir $(DEST_SYN) $(DEST_IND)
-rm -rf $(DEST_FTP)/*.vim $(DEST_FTP)/README.txt $(DEST_FTP)/logtalk.dict
-rm -f $(DEST_AUTO)/*.vim $(DEST_AUTO)/README.txt
Expand Down
37 changes: 37 additions & 0 deletions src/testdir/test_filetype.vim
Expand Up @@ -1642,13 +1642,16 @@ func Test_mod_file()
call writefile(['IMPLEMENTATION MODULE Module2Mod;'], 'modfile.MOD')
split modfile.MOD
call assert_equal('modula2', &filetype)
call assert_equal('pim', b:modula2.dialect)
bwipe!

" Modula-2 with comment and empty lines prior MODULE
call writefile(['', '(* with', ' comment *)', '', 'MODULE Module2Mod;'], 'modfile.MOD')
split modfile.MOD
call assert_equal('modula2', &filetype)
call assert_equal('pim', b:modula2.dialect)
bwipe!

call delete('modfile.MOD')

" LambdaProlog module
Expand Down Expand Up @@ -2376,4 +2379,38 @@ func Test_i_file()
filetype off
endfunc

func Test_def_file()
filetype on

call writefile(['this is the fallback'], 'Xfile.def', 'D')
split Xfile.def
call assert_equal('def', &filetype)
bwipe!

" Test dist#ft#FTdef()

let g:filetype_def = 'modula2'
split Xfile.def
call assert_equal('modula2', &filetype)
call assert_equal('pim', b:modula2.dialect)
bwipe!
unlet g:filetype_def

" Modula-2

call writefile(['(* a Modula-2 comment *)'], 'Xfile.def')
split Xfile.def
call assert_equal('modula2', &filetype)
call assert_equal('pim', b:modula2.dialect)
bwipe!

call writefile(['IMPLEMENTATION MODULE Module2Mod;'], 'Xfile.def')
split Xfile.def
call assert_equal('modula2', &filetype)
call assert_equal('pim', b:modula2.dialect)
bwipe!

filetype off
endfunc

" vim: shiftwidth=2 sts=2 expandtab