annotate runtime/syntax/forth.vim @ 22804:af26fadf333d v8.2.1950

patch 8.2.1950: Vim9: crash when compiling function fails when getting type Commit: https://github.com/vim/vim/commit/9c13f76275047a4d6302c077fb40bc9c397ff027 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 4 12:00:53 2020 +0100 patch 8.2.1950: Vim9: crash when compiling function fails when getting type Problem: Vim9: crash when compiling function fails when getting type. Solution: Handle NULL type. (closes https://github.com/vim/vim/issues/7253)
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Nov 2020 12:15:03 +0100
parents 5b7ea82bc18f
children 11b656e74444
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 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: FORTH
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
3 " Current Maintainer: Johan Kotlinski <kotlinski@gmail.com>
22723
5b7ea82bc18f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13566
diff changeset
4 " Previous Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
5 " Last Change: 2018-03-29
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Filenames: *.fs,*.ft
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
7 " URL: https://github.com/jkotlinski/forth.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3557
diff changeset
9 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3557
diff changeset
10 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3256
ba708ee8d69d Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2229
diff changeset
14 let s:cpo_save = &cpo
ba708ee8d69d Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2229
diff changeset
15 set cpo&vim
ba708ee8d69d Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2229
diff changeset
16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Synchronization method
15
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
18 syn sync ccomment
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
19 syn sync maxlines=200
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " I use gforth, so I set this to case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Some special, non-FORTH keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword forthTodo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match forthTodo contained 'Copyright\(\s([Cc])\)\=\(\s[0-9]\{2,4}\)\='
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " Characters allowed in keywords
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
29 " I don't know if 128-255 are allowed in ANS-FORTH
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3557
diff changeset
30 setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
32 " when wanted, highlight trailing white space
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
33 if exists("forth_space_errors")
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
34 if !exists("forth_no_trail_space_error")
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
35 syn match forthSpaceError display excludenl "\s\+$"
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
36 endif
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
37 if !exists("forth_no_tab_space_error")
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
38 syn match forthSpaceError display " \+\t"me=e-1
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
39 endif
73fe8baea242 updated for version 7.2a
vimboss
parents: 15
diff changeset
40 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " Keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " basic mathematical and logical operators
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword forthOperators + - * / MOD /MOD NEGATE ABS MIN MAX
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
46 syn keyword forthOperators AND OR XOR NOT LSHIFT RSHIFT INVERT 2* 2/ 1+
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
47 syn keyword forthOperators 1- 2+ 2- 8* UNDER+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword forthOperators M+ */ */MOD M* UM* M*/ UM/MOD FM/MOD SM/REM
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
49 syn keyword forthOperators D+ D- DNEGATE DABS DMIN DMAX D2* D2/
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword forthOperators F+ F- F* F/ FNEGATE FABS FMAX FMIN FLOOR FROUND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword forthOperators F** FSQRT FEXP FEXPM1 FLN FLNP1 FLOG FALOG FSIN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword forthOperators FCOS FSINCOS FTAN FASIN FACOS FATAN FATAN2 FSINH
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
53 syn keyword forthOperators FCOSH FTANH FASINH FACOSH FATANH F2* F2/ 1/F
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
54 syn keyword forthOperators F~REL F~ABS F~
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
55 syn keyword forthOperators 0< 0<= 0<> 0= 0> 0>= < <= <> = > >= U< U<=
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
56 syn keyword forthOperators U> U>= D0< D0<= D0<> D0= D0> D0>= D< D<= D<>
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
57 syn keyword forthOperators D= D> D>= DU< DU<= DU> DU>= WITHIN ?NEGATE
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
58 syn keyword forthOperators ?DNEGATE TRUE FALSE
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
59
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
60 " various words that take an input and do something with it
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
61 syn keyword forthFunction . U. .R U.R
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " stack manipulations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword forthStack DROP NIP DUP OVER TUCK SWAP ROT -ROT ?DUP PICK ROLL
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
65 syn keyword forthStack 2DROP 2NIP 2DUP 2OVER 2TUCK 2SWAP 2ROT 2-ROT
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
66 syn keyword forthStack 3DUP 4DUP 5DUP 3DROP 4DROP 5DROP 8DROP 4SWAP 4ROT
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
67 syn keyword forthStack 4-ROT 4TUCK 8SWAP 8DUP
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword forthRStack >R R> R@ RDROP 2>R 2R> 2R@ 2RDROP
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
69 syn keyword forthRstack 4>R 4R> 4R@ 4RDROP
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword forthFStack FDROP FNIP FDUP FOVER FTUCK FSWAP FROT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " stack pointer manipulations
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
73 syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP! DEPTH
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " address operations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword forthMemory @ ! +! C@ C! 2@ 2! F@ F! SF@ SF! DF@ DF!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn keyword forthAdrArith CHARS CHAR+ CELLS CELL+ CELL ALIGN ALIGNED FLOATS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn keyword forthAdrArith FLOAT+ FLOAT FALIGN FALIGNED SFLOATS SFLOAT+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword forthAdrArith SFALIGN SFALIGNED DFLOATS DFLOAT+ DFALIGN DFALIGNED
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword forthAdrArith MAXALIGN MAXALIGNED CFALIGN CFALIGNED
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword forthAdrArith ADDRESS-UNIT-BITS ALLOT ALLOCATE HERE
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
82 syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK UNUSED
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " conditionals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn keyword forthCond IF ELSE ENDIF THEN CASE OF ENDOF ENDCASE ?DUP-IF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn keyword forthCond ?DUP-0=-IF AHEAD CS-PICK CS-ROLL CATCH THROW WITHIN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 " iterations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn keyword forthLoop BEGIN WHILE REPEAT UNTIL AGAIN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn keyword forthLoop ?DO LOOP I J K +DO U+DO -DO U-DO DO +LOOP -LOOP
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
91 syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT RECURSE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " new words
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
94 syn match forthClassDef '\<:class\s*[^ \t]\+\>'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
95 syn match forthObjectDef '\<:object\s*[^ \t]\+\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match forthColonDef '\<:m\?\s*[^ \t]\+\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn keyword forthEndOfColonDef ; ;M ;m
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
98 syn keyword forthEndOfClassDef ;class
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
99 syn keyword forthEndOfObjectDef ;object
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
100 syn keyword forthDefine CONSTANT 2CONSTANT FCONSTANT VARIABLE 2VARIABLE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
101 syn keyword forthDefine FVARIABLE CREATE USER VALUE TO DEFER IS DOES> IMMEDIATE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
102 syn keyword forthDefine COMPILE-ONLY COMPILE RESTRICT INTERPRET POSTPONE EXECUTE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
103 syn keyword forthDefine LITERAL CREATE-INTERPRET/COMPILE INTERPRETATION>
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
104 syn keyword forthDefine <INTERPRETATION COMPILATION> <COMPILATION ] LASTXT
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
105 syn keyword forthDefine COMP' POSTPONE, FIND-NAME NAME>INT NAME?INT NAME>COMP
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
106 syn keyword forthDefine NAME>STRING STATE C; CVARIABLE BUFFER: MARKER
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
107 syn keyword forthDefine , 2, F, C, COMPILE,
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
108 syn match forthDefine "\[IFDEF]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
109 syn match forthDefine "\[IFUNDEF]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
110 syn match forthDefine "\[THEN]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
111 syn match forthDefine "\[ENDIF]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
112 syn match forthDefine "\[ELSE]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
113 syn match forthDefine "\[?DO]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
114 syn match forthDefine "\[DO]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
115 syn match forthDefine "\[LOOP]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
116 syn match forthDefine "\[+LOOP]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
117 syn match forthDefine "\[NEXT]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
118 syn match forthDefine "\[BEGIN]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
119 syn match forthDefine "\[UNTIL]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
120 syn match forthDefine "\[AGAIN]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
121 syn match forthDefine "\[WHILE]"
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
122 syn match forthDefine "\[REPEAT]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 syn match forthDefine "\[COMP']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 syn match forthDefine "'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 syn match forthDefine '\<\[\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 syn match forthDefine "\[']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 syn match forthDefine '\[COMPILE]'
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
128 syn match forthDefine '\[CHAR]'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 " debugging
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn keyword forthDebug PRINTDEBUGDATA PRINTDEBUGLINE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 syn match forthDebug "\<\~\~\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 " Assembler
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 syn keyword forthAssembler ASSEMBLER CODE END-CODE ;CODE FLUSH-ICACHE C,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 " basic character operations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn keyword forthCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
139 syn keyword forthCharOps KEY? TIB CR BL COUNT SPACE SPACES
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 " recognize 'char (' or '[char] (' correctly, so it doesn't
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 " highlight everything after the paren as a comment till a closing ')'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 syn match forthCharOps '\<char\s\S\s'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 syn match forthCharOps '\<\[char\]\s\S\s'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 syn region forthCharOps start=+."\s+ skip=+\\"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 " char-number conversion
3256
ba708ee8d69d Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2229
diff changeset
147 syn keyword forthConversion <<# <# # #> #>> #S (NUMBER) (NUMBER?) CONVERT D>F
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
148 syn keyword forthConversion D>S DIGIT DPL F>D HLD HOLD NUMBER S>D SIGN >NUMBER
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
149 syn keyword forthConversion F>S S>F HOLDS
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150
2229
d45902a5c61c Fix a few more things for persistent undo.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
151 " interpreter, wordbook, compiler
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 syn keyword forthForth (LOCAL) BYE COLD ABORT >BODY >NEXT >LINK CFA >VIEW HERE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 syn keyword forthForth PAD WORDS VIEW VIEW> N>LINK NAME> LINK> L>NAME FORGET
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
154 syn keyword forthForth BODY> ASSERT( ASSERT0( ASSERT1( ASSERT2( ASSERT3( )
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
155 syn keyword forthForth >IN ACCEPT ENVIRONMENT? EVALUATE QUIT SOURCE ACTION-OF
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
156 syn keyword forthForth DEFER! DEFER@ PARSE PARSE-NAME REFILL RESTORE-INPUT
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
157 syn keyword forthForth SAVE-INPUT SOURCE-ID
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 syn region forthForth start=+ABORT"\s+ skip=+\\"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 " vocabularies
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 syn keyword forthVocs ONLY FORTH ALSO ROOT SEAL VOCS ORDER CONTEXT #VOCS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 syn keyword forthVocs VOCABULARY DEFINITIONS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
164 " File keywords
3256
ba708ee8d69d Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2229
diff changeset
165 syn keyword forthFileMode R/O R/W W/O BIN
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
166 syn keyword forthFileWords OPEN-FILE CREATE-FILE CLOSE-FILE DELETE-FILE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
167 syn keyword forthFileWords RENAME-FILE READ-FILE READ-LINE KEY-FILE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
168 syn keyword forthFileWords KEY?-FILE WRITE-FILE WRITE-LINE EMIT-FILE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
169 syn keyword forthFileWords FLUSH-FILE FILE-STATUS FILE-POSITION
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
170 syn keyword forthFileWords REPOSITION-FILE FILE-SIZE RESIZE-FILE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
171 syn keyword forthFileWords SLURP-FILE SLURP-FID STDIN STDOUT STDERR
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
172 syn keyword forthFileWords INCLUDE-FILE INCLUDED REQUIRED
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
173 syn keyword forthBlocks OPEN-BLOCKS USE LOAD --> BLOCK-OFFSET
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
174 syn keyword forthBlocks GET-BLOCK-FID BLOCK-POSITION LIST SCR BLOCK
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
175 syn keyword forthBlocks BUFER EMPTY-BUFFERS EMPTY-BUFFER UPDATE UPDATED?
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
176 syn keyword forthBlocks SAVE-BUFFERS SAVE-BUFFER FLUSH THRU +LOAD +THRU
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
177 syn keyword forthBlocks BLOCK-INCLUDED BLK
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
178
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 " numbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 syn keyword forthMath DECIMAL HEX BASE
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
181 syn match forthInteger '\<-\=[0-9]\+.\=\>'
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
182 syn match forthInteger '\<&-\=[0-9]\+.\=\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 " recognize hex and binary numbers, the '$' and '%' notation is for gforth
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 syn match forthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 syn match forthInteger '\<\x*\d\x*\>' " *2* --- this order!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 syn match forthInteger '\<%[0-1]*[0-1]\+\>'
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
187 syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe]\d\+\>'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
188 syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe][-+]\d\+\>'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
189
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
190 " XXX If you find this overkill you can remove it. this has to come after the
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
191 " highlighting for numbers otherwise it has no effect.
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
192 syn region forthComment start='0 \[if\]' end='\[endif\]' end='\[then\]' contains=forthTodo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 " Strings
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
195 syn region forthString start=+\.*\"+ end=+"+ end=+$+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 " XXX
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
197 syn region forthString start=+s\"+ end=+"+ end=+$+
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
198 syn region forthString start=+s\\\"+ end=+"+ end=+$+
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
199 syn region forthString start=+c\"+ end=+"+ end=+$+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 " Comments
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
202 syn match forthComment '\\\s.*$' contains=forthTodo,forthSpaceError
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
203 syn region forthComment start='\\S\s' end='.*' contains=forthTodo,forthSpaceError
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
204 syn match forthComment '\.(\s[^)]*)' contains=forthTodo,forthSpaceError
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
205 syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=forthTodo,forthSpaceError
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
206 syn region forthComment start='/\*' end='\*/' contains=forthTodo,forthSpaceError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 " Include files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 syn match forthInclude '^INCLUDE\s\+\k\+'
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
210 syn match forthInclude '^REQUIRE\s\+\k\+'
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
211 syn match forthInclude '^FLOAD\s\+'
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
212 syn match forthInclude '^NEEDS\s\+'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
214 " Locals definitions
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
215 syn region forthLocals start='{\s' start='{$' end='\s}' end='^}'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
216 syn match forthLocals '{ }' " otherwise, at least two spaces between
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
217 syn region forthDeprecated start='locals|' end='|'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1620
diff changeset
218
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 " Define the default highlighting.
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
220 hi def link forthTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
221 hi def link forthOperators Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
222 hi def link forthMath Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
223 hi def link forthInteger Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
224 hi def link forthFloat Float
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
225 hi def link forthStack Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
226 hi def link forthRstack Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
227 hi def link forthFStack Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
228 hi def link forthSP Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
229 hi def link forthMemory Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
230 hi def link forthAdrArith Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
231 hi def link forthMemBlks Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
232 hi def link forthCond Conditional
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
233 hi def link forthLoop Repeat
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
234 hi def link forthColonDef Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
235 hi def link forthEndOfColonDef Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
236 hi def link forthDefine Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
237 hi def link forthDebug Debug
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
238 hi def link forthAssembler Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
239 hi def link forthCharOps Character
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
240 hi def link forthConversion String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
241 hi def link forthForth Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
242 hi def link forthVocs Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
243 hi def link forthString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
244 hi def link forthComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
245 hi def link forthClassDef Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
246 hi def link forthEndOfClassDef Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
247 hi def link forthObjectDef Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
248 hi def link forthEndOfObjectDef Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
249 hi def link forthInclude Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
250 hi def link forthLocals Type " nothing else uses type and locals must stand out
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
251 hi def link forthDeprecated Error " if you must, change to Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
252 hi def link forthFileMode Function
13566
c9bacbda2d5b Small runtime update
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
253 hi def link forthFunction Function
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
254 hi def link forthFileWords Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
255 hi def link forthBlocks Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
256 hi def link forthSpaceError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 let b:current_syntax = "forth"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259
3256
ba708ee8d69d Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2229
diff changeset
260 let &cpo = s:cpo_save
ba708ee8d69d Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2229
diff changeset
261 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 " vim:ts=8:sw=4:nocindent:smartindent: