diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2021-03-01 13:44:50 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2021-03-01 13:44:50 +0100 |
commit | cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef (patch) | |
tree | 260360b1a32ca19635f8c8884b81fcec9ed51168 /syntax/basic | |
parent | 4c10562d2cc9b084518284c49a158558da5180a7 (diff) | |
download | vim-polyglot-cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef.tar.gz vim-polyglot-cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef.zip |
Update
Diffstat (limited to '')
-rw-r--r-- | syntax/basic.vim | 62 | ||||
-rw-r--r-- | syntax/basic/literal.vim | 6 | ||||
-rw-r--r-- | syntax/basic/type.vim | 3 |
3 files changed, 41 insertions, 30 deletions
diff --git a/syntax/basic.vim b/syntax/basic.vim index 1b98eb8d..3502fa14 100644 --- a/syntax/basic.vim +++ b/syntax/basic.vim @@ -3,16 +3,18 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'basic', 'syntax/basic.vim') endif " Vim syntax file -" Language: BASIC -" Maintainer: Allan Kelly <allan@fruitloaf.co.uk> -" Last Change: 2011 Dec 25 by Thilo Six +" Language: BASIC +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Allan Kelly <allan@fruitloaf.co.uk> +" Contributors: Thilo Six +" Last Change: 2015 Jan 10 " First version based on Micro$soft QBASIC circa 1989, as documented in " 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989. " This syntax file not a complete implementation yet. Send suggestions to the " maintainer. -" quit when a syntax file was already loaded +" Prelude {{{1 if exists("b:current_syntax") finish endif @@ -20,7 +22,7 @@ endif let s:cpo_save = &cpo set cpo&vim -" A bunch of useful BASIC keywords +" Keywords {{{1 syn keyword basicStatement BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave syn keyword basicStatement CALL call Call ABSOLUTE absolute Absolute syn keyword basicStatement CHAIN chain Chain CHDIR chdir Chdir @@ -120,32 +122,39 @@ syn keyword basicFunction RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$ syn keyword basicFunction SPACE$ space$ Space$ STR$ str$ Str$ syn keyword basicFunction STRING$ string$ String$ TIME$ time$ Time$ syn keyword basicFunction UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$ -syn keyword basicTodo contained TODO -"integer number, or floating point number without a dot. +" Numbers {{{1 +" Integer number, or floating point number without a dot. syn match basicNumber "\<\d\+\>" -"floating point number, with dot +" Floating point number, with dot syn match basicNumber "\<\d\+\.\d*\>" -"floating point number, starting with a dot +" Floating point number, starting with a dot syn match basicNumber "\.\d\+\>" -" String and Character contstants -syn match basicSpecial contained "\\\d\d\d\|\\." -syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial +" String and Character constants {{{1 +syn match basicSpecial "\\\d\d\d\|\\." contained +syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial -syn region basicComment start="REM" end="$" contains=basicTodo -syn region basicComment start="^[ \t]*'" end="$" contains=basicTodo +" Line numbers {{{1 syn region basicLineNumber start="^\d" end="\s" -syn match basicTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 + +" Data-type suffixes {{{1 +syn match basicTypeSpecifier "[a-zA-Z0-9][$%&!#]"ms=s+1 " Used with OPEN statement syn match basicFilenumber "#\d\+" -"syn sync ccomment basicComment + +" Mathematical operators {{{1 " syn match basicMathsOperator "[<>+\*^/\\=-]" -syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR" +syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR" -" Define the default highlighting. -" Only when an item doesn't have highlighting yet +" Comments {{{1 +syn keyword basicTodo TODO FIXME XXX NOTE contained +syn region basicComment start="^\s*\zsREM\>" start="\%(:\s*\)\@<=REM\>" end="$" contains=basicTodo +syn region basicComment start="'" end="$" contains=basicTodo +"syn sync ccomment basicComment + +" Default Highlighting {{{1 hi def link basicLabel Label hi def link basicConditional Conditional hi def link basicRepeat Repeat @@ -154,17 +163,18 @@ hi def link basicNumber Number hi def link basicError Error hi def link basicStatement Statement hi def link basicString String -hi def link basicComment Comment -hi def link basicSpecial Special +hi def link basicComment Comment +hi def link basicSpecial Special hi def link basicTodo Todo -hi def link basicFunction Identifier -hi def link basicTypeSpecifier Type -hi def link basicFilenumber basicTypeSpecifier +hi def link basicFunction Identifier +hi def link basicTypeSpecifier Type +hi def link basicFilenumber basicTypeSpecifier "hi basicMathsOperator term=bold cterm=bold gui=bold - +" Postscript {{{1 let b:current_syntax = "basic" let &cpo = s:cpo_save unlet s:cpo_save -" vim: ts=8 + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/syntax/basic/literal.vim b/syntax/basic/literal.vim index 81bbef96..de71af92 100644 --- a/syntax/basic/literal.vim +++ b/syntax/basic/literal.vim @@ -13,9 +13,11 @@ syntax region typescriptTemplateSubstitution matchgroup=typescriptTemplateSB \ contained -syntax region typescriptString +syntax region typescriptString \ start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+ \ contains=typescriptSpecial,@Spell + \ nextgroup=@typescriptSymbols + \ skipwhite skipempty \ extend syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)" @@ -42,4 +44,4 @@ syntax match typescriptNumber /\<0[bB][01][01_]*\>/ nextgroup=@typescript syntax match typescriptNumber /\<0[oO][0-7][0-7_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty syntax match typescriptNumber /\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty syntax match typescriptNumber /\<\%(\d[0-9_]*\%(\.\d[0-9_]*\)\=\|\.\d[0-9_]*\)\%([eE][+-]\=\d[0-9_]*\)\=\>/ - \ nextgroup=typescriptSymbols skipwhite skipempty + \ nextgroup=@typescriptSymbols skipwhite skipempty diff --git a/syntax/basic/type.vim b/syntax/basic/type.vim index 770d3e0d..590dda1a 100644 --- a/syntax/basic/type.vim +++ b/syntax/basic/type.vim @@ -132,7 +132,7 @@ syntax region typescriptGenericFunc matchgroup=typescriptTypeBrackets \ contained skipwhite skipnl syntax region typescriptFuncType matchgroup=typescriptParens - \ start=/(/ end=/)\s*=>/me=e-2 + \ start=/(\(\k\+:\|)\)\@=/ end=/)\s*=>/me=e-2 \ contains=@typescriptParameterList \ nextgroup=typescriptFuncTypeArrow \ contained skipwhite skipnl oneline @@ -142,7 +142,6 @@ syntax match typescriptFuncTypeArrow /=>/ \ containedin=typescriptFuncType \ contained skipwhite skipnl - syntax keyword typescriptConstructorType new \ nextgroup=@typescriptFunctionType \ contained skipwhite skipnl |