From aed8ce9da277f5ecffe968b324f242c41c3b752a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 10:50:31 +0200 Subject: Adding upstream version 2:9.0.1378. Signed-off-by: Daniel Baumann --- runtime/syntax/falcon.vim | 197 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 runtime/syntax/falcon.vim (limited to 'runtime/syntax/falcon.vim') diff --git a/runtime/syntax/falcon.vim b/runtime/syntax/falcon.vim new file mode 100644 index 0000000..e022c7a --- /dev/null +++ b/runtime/syntax/falcon.vim @@ -0,0 +1,197 @@ +" Vim syntax file +" Language: Falcon +" Maintainer: Steven Oliver +" Website: http://github.com/steveno/vim-files/blob/master/syntax/falcon.vim +" Credits: Thanks the ruby.vim authors, I borrowed a lot! +" Thanks to the lisp authors for the rainbow code! +" ------------------------------------------------------------------------------- + +" When wanted, highlight the trailing whitespace. +if exists("c_space_errors") + if !exists("c_no_trail_space_error") + syn match falconSpaceError "\s\+$" + endif + + if !exists("c_no_tab_space_error") + syn match falconSpaceError " \+\t"me=e-1 + endif +endif + +" Symbols +syn match falconSymbol "\(;\|,\|\.\)" +syn match falconSymbolOther "\(#\|@\)" display + +" Operators +syn match falconOperator "\(+\|-\|\*\|/\|=\|<\|>\|\*\*\|!=\|\~=\)" +syn match falconOperator "\(<=\|>=\|=>\|\.\.\|<<\|>>\|\"\)" + +" Clusters +syn region falconSymbol start="[]})\"':]\@\|::\)\@=\%(\s*(\)\@!" + +" Comments +syn match falconCommentSkip contained "^\s*\*\($\|\s\+\)" +syn region falconComment start="/\*" end="\*/" contains=@falconCommentGroup,falconSpaceError,falconTodo +syn region falconCommentL start="//" end="$" keepend contains=@falconCommentGroup,falconSpaceError,falconTodo +syn match falconSharpBang "\%^#!.*" display +syn sync ccomment falconComment + +" Numbers +syn match falconNumbers transparent "\<[+-]\=\d\|[+-]\=\.\d" contains=falconIntLiteral,falconFloatLiteral,falconHexadecimal,falconOctal +syn match falconNumbersCom contained transparent "\<[+-]\=\d\|[+-]\=\.\d" contains=falconIntLiteral,falconFloatLiteral,falconHexadecimal,falconOctal +syn match falconHexadecimal contained "\<0x\x\+\>" +syn match falconOctal contained "\<0\o\+\>" +syn match falconIntLiteral contained "[+-]\" +syn match falconFloatLiteral contained "[+-]\=\d\+\.\d*" +syn match falconFloatLiteral contained "[+-]\=\d*\.\d*" + +" Includes +syn keyword falconInclude load import + +" Expression Substitution and Backslash Notation +syn match falconStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display +syn match falconStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display +syn region falconSymbol start="[]})\"':]\@" skip="\\\\\|\\>" fold contains=falconDelimEscape +syn region falconString matchgroup=falconStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=falconDelimEscape +syn region falconString matchgroup=falconStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=falconDelimEscape +syn region falconSymbol matchgroup=falconSymbolDelimiter start="%[s]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold +syn region falconSymbol matchgroup=falconSymbolDelimiter start="%[s]{" end="}" skip="\\\\\|\\}" fold contains=falconDelimEscape +syn region falconSymbol matchgroup=falconSymbolDelimiter start="%[s]<" end=">" skip="\\\\\|\\>" fold contains=falconDelimEscape +syn region falconSymbol matchgroup=falconSymbolDelimiter start="%[s]\[" end="\]" skip="\\\\\|\\\]" fold contains=falconDelimEscape +syn region falconSymbol matchgroup=falconSymbolDelimiter start="%[s](" end=")" skip="\\\\\|\\)" fold contains=falconDelimEscape + +" Generalized Double Quoted String and Array of Strings and Shell Command Output +syn region falconString matchgroup=falconStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=falconStringEscape fold +syn region falconString matchgroup=falconStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=falconStringEscape fold +syn region falconString matchgroup=falconStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=falconStringEscape,falconDelimEscape fold +syn region falconString matchgroup=falconStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=falconStringEscape,falconDelimEscape fold +syn region falconString matchgroup=falconStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=falconStringEscape,falconDelimEscape fold +syn region falconString matchgroup=falconStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=falconStringEscape,falconDelimEscape fold + +syn region falconString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@