annotate runtime/syntax/aflex.vim @ 25497:2246bcbeff89 v8.2.3285

patch 8.2.3285: scdoc filetype is not recognized Commit: https://github.com/vim/vim/commit/dd097bdc1376e4ca2cfd4a4d64021b6ba0df4bed Author: Gregory Anders <greg@gpanders.com> Date: Wed Aug 4 20:00:27 2021 +0200 patch 8.2.3285: scdoc filetype is not recognized Problem: Scdoc filetype is not recognized. Solution: Add filetype detection. (Gregory Anders, closes https://github.com/vim/vim/issues/8701)
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Aug 2021 20:15:03 +0200
parents 46763b01cd9a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Language: AfLex (from Lex syntax file)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " LastChange: 02 May 2001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Original: Lex, maintained by Dr. Charles E. Campbell, Jr.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Comment: Replaced sourcing c.vim file by ada.vim and rename lex*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " in aflex*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
10 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
11 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " Read the Ada syntax to start with
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
16 runtime! syntax/ada.vim
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
17 unlet b:current_syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " --- AfLex stuff ---
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 "I'd prefer to use aflex.* , but it doesn't handle forward definitions yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn cluster aflexListGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatString,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,aflexPatCode,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn cluster aflexListPatCodeGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " Abbreviations Section
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn region aflexAbbrvBlock start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2 skipnl nextgroup=aflexPatBlock contains=aflexAbbrv,aflexInclude,aflexAbbrvComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match aflexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=aflexAbbrvRegExp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match aflexAbbrv "^%[sx]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match aflexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=aflexAbbrv,aflexInclude
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn region aflexInclude matchgroup=aflexSep start="^%{" end="%}" contained contains=ALLBUT,@aflexListGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn region aflexAbbrvComment start="^\s\+/\*" end="\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 "%% : Patterns {Actions}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn region aflexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=aflexPat,aflexPatTag,aflexPatComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn region aflexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=aflexMorePat,aflexPatSep contains=aflexPatString,aflexSlashQuote,aflexBrace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn region aflexBrace start="\[" skip=+\\\\\|\\+ end="]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn region aflexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match aflexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match aflexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn region aflexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo nextgroup=aflexPatComment,aflexPat,aflexPatString,aflexPatTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match aflexPatCodeLine ".*$" contained contains=ALLBUT,@aflexListGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match aflexMorePat "\s*|\s*$" skipnl contained nextgroup=aflexPat,aflexPatTag,aflexPatComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match aflexPatSep "\s\+" contained nextgroup=aflexMorePat,aflexPatCode,aflexPatCodeLine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match aflexSlashQuote +\(\\\\\)*\\"+ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn region aflexPatCode matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" skipnl contained contains=ALLBUT,@aflexListPatCodeGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword aflexCFunctions BEGIN input unput woutput yyleng yylook yytext
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword aflexCFunctions ECHO output winput wunput yyless yymore yywrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " <c.vim> includes several ALLBUTs; these have to be treated so as to exclude aflex* groups
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn cluster cParenGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn cluster cDefineGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn cluster cPreProcGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn cluster cMultiGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " Synchronization
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn sync clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn sync minlines=300
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn sync match aflexSyncPat grouphere aflexPatBlock "^%[a-zA-Z]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn sync match aflexSyncPat groupthere aflexPatBlock "^<$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn sync match aflexSyncPat groupthere aflexPatBlock "^%%$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
65 " Only when an item doesn't have highlighting yet
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
66 hi def link aflexSlashQuote aflexPat
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
67 hi def link aflexBrace aflexPat
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
68 hi def link aflexAbbrvComment aflexPatComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
70 hi def link aflexAbbrv SpecialChar
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
71 hi def link aflexAbbrvRegExp Macro
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
72 hi def link aflexCFunctions Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
73 hi def link aflexMorePat SpecialChar
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
74 hi def link aflexPat Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
75 hi def link aflexPatComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
76 hi def link aflexPatString Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
77 hi def link aflexPatTag Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
78 hi def link aflexSep Delimiter
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 let b:current_syntax = "aflex"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " vim:ts=10