-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime(miranda): Add new syntax and ftplugin files
- Loading branch information
Showing
15 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
" Vim filetype plugin file | ||
" Language: Miranda | ||
" Maintainer: Doug Kearns <[email protected]> | ||
" Last Change: 2024 Jan 30 | ||
|
||
if exists("b:did_ftplugin") | ||
finish | ||
endif | ||
let b:did_ftplugin = 1 | ||
|
||
setlocal comments=:\|\| | ||
setlocal commentstring=\|\|\ %s | ||
setlocal formatoptions+=croql formatoptions-=t | ||
|
||
setlocal iskeyword=a-z,A-Z,48-57,_,' | ||
|
||
let &l:include = '%\%(insert\|include\)' | ||
setlocal suffixes+=.x | ||
setlocal suffixesadd=.m | ||
|
||
let b:undo_ftplugin = "setl cms< com< fo< inc< isk< su< sua<" | ||
|
||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | ||
let b:browsefilter = | ||
\ "Miranda Script Files (*.m)\t*.m\n" .. | ||
\ "Miranda Literate Script Files (*.lit.m)\t*.lit.m\n" | ||
if has("win32") | ||
let b:browsefilter ..= "All Files (*.*)\t*\n" | ||
else | ||
let b:browsefilter ..= "All Files (*)\t*\n" | ||
endif | ||
let b:undo_ftplugin ..= " | unlet! b:browsefilter" | ||
endif | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8 noet: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
" Vim syntax file | ||
" Language: Miranda | ||
" Maintainer: Doug Kearns <[email protected]> | ||
" Last Change: 2024 Feb 01 | ||
|
||
if exists("b:current_syntax") | ||
finish | ||
endif | ||
|
||
syn iskeyword a-z,A-Z,48-57,_,' | ||
|
||
if miranda#GetFileTypeInfo().literate | ||
syn include @mirandaTop syntax/shared/miranda.vim | ||
syn region mirandaLiterate start="^[^>[:space:]]" end="^\ze\%(\s*\n\)*>\|\%$" | ||
syn region mirandaProgram start="^>" skip="^>" end="^\ze\s*$\|\%$" contains=@mirandaTop | ||
|
||
syn sync linebreaks=2 | ||
|
||
hi def link mirandaLiterate Comment | ||
else | ||
runtime! syntax/shared/miranda.vim | ||
endif | ||
|
||
syn match mirandaSharpBang "\%^#!.*" display | ||
|
||
hi def link mirandaSharpBang PreProc | ||
|
||
let b:current_syntax = "miranda" | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
" Vim syntax file | ||
" Language: Miranda | ||
" Maintainer: Doug Kearns <[email protected]> | ||
" Last Change: 2024 Feb 01 | ||
|
||
syn iskeyword a-z,A-Z,48-57,_,' | ||
|
||
" Operators {{{1 | ||
" list | ||
syn match mirandaOperator "\%([:#!]\|++\|--\)" | ||
" relational | ||
syn match mirandaOperator "\%(\\/\|&\|\~\)\|\%(>\|>=\|=\|\~=\|<=\|<\)" | ||
" arithmetic | ||
syn match mirandaOperator "[+\-*/^]" | ||
syn keyword mirandaOperator div mod | ||
" function | ||
syn match mirandaOperator "\.\|$\a\@=" | ||
|
||
" Reserved {{{1 | ||
syn keyword mirandaReserved | ||
\ abstype if otherwise readvals show type where with | ||
"\ div mod | ||
|
||
" Functions {{{1 | ||
syn keyword mirandaFunction | ||
\ abs and arctan cjustify code concat const converse cos decode digit | ||
\ drop dropwhile e entier error exp filemode filter foldl foldl1 foldr | ||
\ foldr1 force fst getenv hd hugenum id index init integer iterate last | ||
\ lay layn letter limit lines ljustify log log10 map map2 max max2 | ||
\ member merge min min2 mkset neg numval or pi postfix product read | ||
\ readb rep repeat reverse rjustify scan seq showfloat showhex shownum | ||
\ showoct showscaled sin snd sort spaces sqrt subtract sum system take | ||
\ takewhile tinynum tl transpose undef until zip2 zip3 zip4 zip5 zip6 | ||
\ zip | ||
" Constants {{{1 | ||
syn keyword mirandaConstant e pi tinynum | ||
syn keyword mirandaUndef undef | ||
|
||
" Constructors {{{1 | ||
syn keyword mirandaFunction | ||
\ Appendfile Appendfileb Closefile Exit Stderr Stdout Stdoutb System | ||
\ Tofile Tofileb | ||
|
||
syn keyword mirandaType bool char num sys_message | ||
" syn match mirandaTypeVar "\*\+" | ||
|
||
" Literals {{{1 | ||
syn keyword mirandaBoolean True False | ||
|
||
" Numbers {{{2 | ||
syn match mirandaNatural "\<\d\+\>" display | ||
syn match mirandaFloat "\<\d\+e[+-]\=\d\+\>" display | ||
syn match mirandaFloat "\<\d*\.\d\+\%(e[+-]\=\d\+\)\=" display | ||
|
||
" Strings {{{2 | ||
" syn match mirandaEscape /\\[ntfrb\\'"]/ contained | ||
syn match mirandaEscape "\\." contained | ||
syn match mirandaEscape "\\\d\{1,3}" contained | ||
syn match mirandaEscape "\\$" contained | ||
|
||
syn match mirandaCharacter "\<'\%(\\.\|\%(\\$\n\)\=[[:print:]]\)'\>" contains=mirandaEscape | ||
syn region mirandaString start=/"/ skip=/\\\\\|\\"\|\\$/ end=/"/ end=/$/ contains=mirandaEscape,mirandaEscapeError | ||
|
||
" Comments {{{1 | ||
syn keyword mirandaTodo contained TODO FIXME XXX NOTE | ||
syn match mirandaComment "||.*" contains=mirandaTodo,@Spell | ||
|
||
" Compiler directives {{{1 | ||
syn match mirandaCompilerDirective "%\%(list\|nolist\)\>" | ||
syn match mirandaCompilerDirective "%\%(include\|insert\)\>" nextgroup=mirandaFileId skipwhite | ||
syn region mirandaFileId start="<" end=">" contained oneline | ||
syn region mirandaFileId start=+"+ end=+"+ contained oneline | ||
syn match mirandaCompilerDirective "%\%(export\|free\)\>" | ||
|
||
" Highlighting {{{1 | ||
hi def link mirandaBoolean Boolean | ||
hi def link mirandaCharacter Character | ||
hi def link mirandaComment Comment | ||
hi def link mirandaCompilerDirective PreProc | ||
hi def link mirandaConstant Constant | ||
hi def link mirandaEscape Special | ||
hi def link mirandaFileId mirandaString | ||
hi def link mirandaFloat Float | ||
hi def link mirandaFunction Function | ||
hi def link mirandaNatural Number | ||
hi def link mirandaOperator Operator | ||
hi def link mirandaReserved Keyword | ||
hi def link mirandaString String | ||
hi def link mirandaType Type | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
>>+0#af5f00255#ffffff0| +0#0000000&||+0#0000e05&@1| |A| |M|i|r|a|n|d|a| |l|i|t|e|r|a|t|e| |s|c|r|i|p|t| |s|p|e|c|i|f|i|e|d| |b|y| |f|o|r|m|a|l|i|s|i|n|g| |s|y|m|b|o|l| |'|>|'|.| +0#0000000&@7 | ||
@75 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |0+0#e000002&| +0#0000000&|=+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&@62 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |=+0#af5f00255&| +0#0000000&|(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |*+0#af5f00255&| +0#0000000&|f|a|c| |n| @42 | ||
@75 | ||
|S+0#0000e05&|o|m|e| |c|l|o|s|i|n|g| |t|e|x|t|.| +0#0000000&@56 | ||
|~+0#4040ff13&| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|"+0#0000000&|i|n|p|u|t|/|m|i|r|a|n|d|a|-|l|i|t|.|m|"| |6|L|,| |1|3|5|B| @26|1|,|1| @10|A|l@1| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|>+0#af5f00255#ffffff0| +0#0000000&||+0#0000e05&@1| |A| |M|i|r|a|n|d|a| |l|i|t|e|r|a|t|e| |s|c|r|i|p|t| |s|p|e|c|i|f|i|e|d| |b|y| |f|o|r|m|a|l|i|s|i|n|g| |s|y|m|b|o|l| |'|>|'|.| +0#0000000&@7 | ||
@75 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |0+0#e000002&| +0#0000000&|=+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&@62 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |=+0#af5f00255&| +0#0000000&|(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |*+0#af5f00255&| +0#0000000&|f|a|c| |n| @42 | ||
@75 | ||
>S+0#0000e05&|o|m|e| |c|l|o|s|i|n|g| |t|e|x|t|.| +0#0000000&@56 | ||
|~+0#4040ff13&| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|"+0#0000000&|i|n|p|u|t|/|m|i|r|a|n|d|a|-|l|i|t|.|m|"| |6|L|,| |1|3|5|B| @26|6|,|1| @10|A|l@1| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
>A+0#0000e05#ffffff0| |M|i|r|a|n|d|a| |l|i|t|e|r|a|t|e| |s|c|r|i|p|t| |s|p|e|c|i|f|i|e|d| |b|y| |f|i|l|e|n|a|m|e| |e|x|t|e|n|s|i|o|n| |'|*|.|l|i|t|.|m|'|.| +0#0000000&@6 | ||
@75 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |0+0#e000002&| +0#0000000&|=+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&@62 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |=+0#af5f00255&| +0#0000000&|(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |*+0#af5f00255&| +0#0000000&|f|a|c| |n| @42 | ||
@75 | ||
|S+0#0000e05&|o|m|e| |c|l|o|s|i|n|g| |t|e|x|t|.| +0#0000000&@56 | ||
|~+0#4040ff13&| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|"+0#0000000&|i|n|p|u|t|/|m|i|r|a|n|d|a|.|l|i|t|.|m|"| |6|L|,| |1|3|6|B| @26|1|,|1| @10|A|l@1| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|A+0#0000e05#ffffff0| |M|i|r|a|n|d|a| |l|i|t|e|r|a|t|e| |s|c|r|i|p|t| |s|p|e|c|i|f|i|e|d| |b|y| |f|i|l|e|n|a|m|e| |e|x|t|e|n|s|i|o|n| |'|*|.|l|i|t|.|m|'|.| +0#0000000&@6 | ||
@75 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |0+0#e000002&| +0#0000000&|=+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&@62 | ||
|>+0#af5f00255&| +0#0000000&@1|f|a|c| |(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |=+0#af5f00255&| +0#0000000&|(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |*+0#af5f00255&| +0#0000000&|f|a|c| |n| @42 | ||
@75 | ||
>S+0#0000e05&|o|m|e| |c|l|o|s|i|n|g| |t|e|x|t|.| +0#0000000&@56 | ||
|~+0#4040ff13&| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|"+0#0000000&|i|n|p|u|t|/|m|i|r|a|n|d|a|.|l|i|t|.|m|"| |6|L|,| |1|3|6|B| @26|6|,|1| @10|A|l@1| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
>|+0#0000e05#ffffff0@1| |A| |M|i|r|a|n|d|a| |s|c|r|i|p|t|.| +0#0000000&@54 | ||
@75 | ||
|f|a|c| |0+0#e000002&| +0#0000000&|=+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&@65 | ||
|f|a|c| |(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |=+0#af5f00255&| +0#0000000&|(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |*+0#af5f00255&| +0#0000000&|f|a|c| |n| @45 | ||
|~+0#4040ff13&| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|"+0#0000000&|i|n|p|u|t|/|m|i|r|a|n|d|a|.|m|"| |4|L|,| |6|2|B| @31|1|,|1| @10|A|l@1| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
||+0#0000e05#ffffff0@1| |A| |M|i|r|a|n|d|a| |s|c|r|i|p|t|.| +0#0000000&@54 | ||
@75 | ||
|f|a|c| |0+0#e000002&| +0#0000000&|=+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&@65 | ||
>f|a|c| |(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |=+0#af5f00255&| +0#0000000&|(|n| |++0#af5f00255&| +0#0000000&|1+0#e000002&|)+0#0000000&| |*+0#af5f00255&| +0#0000000&|f|a|c| |n| @45 | ||
|~+0#4040ff13&| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|~| @73 | ||
|"+0#0000000&|i|n|p|u|t|/|m|i|r|a|n|d|a|.|m|"| |4|L|,| |6|2|B| @31|4|,|1| @10|A|l@1| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
> || A Miranda literate script specified by formalising symbol '>'. | ||
|
||
> fac 0 = 1 | ||
> fac (n + 1) = (n + 1) * fac n | ||
|
||
Some closing text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
A Miranda literate script specified by filename extension '*.lit.m'. | ||
|
||
> fac 0 = 1 | ||
> fac (n + 1) = (n + 1) * fac n | ||
|
||
Some closing text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|| A Miranda script. | ||
|
||
fac 0 = 1 | ||
fac (n + 1) = (n + 1) * fac n |