Updated to latest version of language.

This commit is contained in:
Bruce Hill 2018-05-15 17:29:26 -07:00
parent dbbbdffb40
commit 997cc4bf5a
2 changed files with 39 additions and 34 deletions

View File

@ -24,9 +24,9 @@ function! GetNomsuIndent()
let previous = getline(previousNum) let previous = getline(previousNum)
let ind = indent(previousNum) let ind = indent(previousNum)
if previous =~ ':\s*\($\|#\)' || previous =~ '(\.\.)\s*\($\|#\)' if previous =~ '{\.\.}\s*\($\|#\)' || previous =~ '(\.\.)\s*\($\|#\)'
\ || previous =~ '\[\.\.\]\s*\($\|#\)' || previous =~ '"\.\."\s*\($\|#\)' \ || previous =~ '\[\.\.\]\s*\($\|#\)' || previous =~ '"\.\."\s*\($\|#\)'
\ || previous =~ '#\.\..*$' \ || previous =~ '#$'
let ind += &tabstop let ind += &tabstop
endif endif

View File

@ -11,42 +11,43 @@ endif
syn sync minlines=100 syn sync minlines=100
hi def link nomsuInterpDelim PreProc hi def link nomsuInterpDelim PreProc
syn region nomsuOneLineComment start=/#\(\.\.\)\@!/ end=/$/ syn region nomsuOneLineComment start=/#/ end=/$/
hi nomsuOneLineComment ctermfg=DarkBlue hi nomsuOneLineComment ctermfg=DarkBlue
hi def link nomsuOneLineComment Comment hi def link nomsuOneLineComment Comment
syn region nomsuComment start=/\(^\z(\s*\)[^\n]*\)\@<=#\.\./ skip=/\n\s*$/ end=/\n\(\z1\s\)\@!/ syn region nomsuComment start=/\(^\z(\s*\)[^\n]*\)\@<=#/ skip=/\n\s*$/ end=/\n\(\z1\s\)\@!/
hi nomsuComment ctermfg=DarkBlue hi nomsuComment ctermfg=DarkBlue
hi def link nomsuComment Comment hi def link nomsuComment Comment
syn region nomsuList start=/\[/ end=/\]/ contains=@nomsuAll,nomsuComma
hi nomsuList ctermfg=Blue
syn region nomsuDict start=/{/ end=/}/ contains=nomsuColon,nomsuComma,@nomsuAll
hi nomsuDict ctermfg=Green
syn region nomsuParenGroup start=/(/ end=/)/ contains=@nomsuAll syn region nomsuParenGroup start=/(/ end=/)/ contains=@nomsuAll
hi nomsuParenGroup ctermfg=Yellow hi nomsuParenGroup ctermfg=Yellow
hi def link nomsuParens Delimiter
syn match nomsuLongStringStart /"\.\."/ contains=nomsuIndentor contained syn match nomsuLongTextStart /"\.\."/ contains=nomsuIndentor contained
hi nomsuLongStringStart ctermfg=Yellow hi nomsuLongTextStart ctermfg=Gray
syn match nomsuStringPipe /|/ contained syn match nomsuTextBackslash /\\\\/ contained
hi nomsuStringPipe ctermfg=DarkGray hi nomsuTextBackslash ctermbg=Black ctermfg=Blue
syn match nomsuStringBackslash /\\\\/ contained syn match nomsuTextEscapedQuote /\\"/ contained
hi nomsuStringBackslash ctermbg=Black ctermfg=Blue hi nomsuTextEscapedQuote ctermbg=Black ctermfg=Blue
syn match nomsuStringEscapedQuote /\\"/ contained
hi nomsuStringEscapedQuote ctermbg=Black ctermfg=Blue
hi def link nomsuStringPipe Special
syn region nomsuInterp matchgroup=nomsuInterpDelim start=/\\(/ end=/)/ contained syn region nomsuInterp matchgroup=nomsuInterpDelim start=/\\(/ end=/)/ contained
\ contains=@nomsuAll \ contains=@nomsuAll
syn region nomsuInterpDotDot matchgroup=nomsuInterpDelim start=/\\$/ end=/\.\./ contained syn region nomsuInterpDotDot matchgroup=nomsuInterpDelim start=/\\$/ end=/\.\./ contained
syn region nomsuLongStringValue start=/\(|\)\@<=/ end=/$/ contained syn region nomsuLongTextValue start=/^/ end=/$/ contained
\ contains=nomsuInterp,nomsuInterpDotDot,nomsuStringBackslash \ contains=nomsuInterp,nomsuInterpDotDot,nomsuTextBackslash
hi nomsuLongStringValue ctermbg=Black ctermfg=Gray hi nomsuLongTextValue ctermfg=Gray
hi def link nomsuLongStringValue String hi def link nomsuLongTextValue Text
syn region nomsuLongStringLine start=/^\s\+|/ end=/\n/ contained syn region nomsuLongText start=/\(^\z(\s*\)[^\n]*\)\@<="\.\."/ skip=/^\s*$/ end=/^\(\z1\s\)\@!/
\ contains=nomsuStringPipe,nomsuLongStringValue \ contains=nomsuLongTextStart,nomsuLongTextValue
syn region nomsuLongString start=/\(^\z(\s*\)[^\n]*\)\@<="\.\."/ skip=/^\s*$/ end=/^\(\z1\s\)\@!/
\ contains=nomsuLongStringStart,nomsuOneLineComment,nomsuComment,nomsuLongStringLine
syn region nomsuString start=/\("\.\.\)\@<!"\(\.\."\)\@!/ skip=/\\\\\|\\"/ end=/$\|"/ syn region nomsuText start=/\("\.\.\)\@<!"\(\.\."\)\@!/ skip=/\\\\\|\\"/ end=/$\|"/
\ contains=nomsuInterp,nomsuStringBackslash,nomsuStringEscapedQuote \ contains=nomsuInterp,nomsuTextBackslash,nomsuTextEscapedQuote
hi nomsuString ctermbg=Black ctermfg=Gray hi nomsuText ctermfg=Gray
hi def link nomsuString String hi def link nomsuText String
syn match nomsuVar /%[a-zA-Z0-9_]*/ syn match nomsuVar /%[a-zA-Z0-9_]*/
hi nomsuVar ctermfg=Cyan hi nomsuVar ctermfg=Cyan
@ -68,16 +69,20 @@ syn match nomsuDotDot /\.\./
hi def link nomsuDotDot Special hi def link nomsuDotDot Special
hi nomsuDotDot ctermfg=DarkGray hi nomsuDotDot ctermfg=DarkGray
syn match nomsuDelim /[,;\[\]{}]/ syn match nomsuComma /,/
hi nomsuDelim ctermfg=Yellow hi nomsuComma ctermfg=Blue
hi def link nomsuDelim Delimiter hi def link nomsuComma Delimiter
syn match nomsuThunk /:/ syn match nomsuColon /:/
hi nomsuThunk ctermfg=Yellow hi nomsuColon ctermfg=Yellow
hi def link nomsuThunk Structure hi def link nomsuColon Delimiter
syn cluster nomsuAll contains=nomsuParenGroup,nomsuString,nomsuLongString,nomsuComment,nomsuOneLineComment, syn match nomsuSemicolon /;/
\ nomsuVar,nomsuNumber,nomsuDelim,nomsuThunk,nomsuDotDot,nomsuWord, hi nomsuSemicolon ctermfg=Blue
hi def link nomsuSemicolon Delimiter
syn cluster nomsuAll contains=nomsuParenGroup,nomsuText,nomsuLongText,nomsuComment,nomsuOneLineComment,
\ nomsuVar,nomsuNumber,nomsuDict,nomsuList,nomsuColon,nomsuSemicolon,nomsuDotDot,nomsuWord,
\ nomsuOpWord \ nomsuOpWord
if !exists('b:current_syntax') if !exists('b:current_syntax')