| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " Vim syntax file | 
					
						
							|  |  |  |  | " Language:    FORTH | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | " Current Maintainer:  Johan Kotlinski <kotlinski@gmail.com> | 
					
						
							|  |  |  |  | " Previous Maintainer:  Christian V. J. Br<42>ssow <cvjb@cvjb.de> | 
					
						
							|  |  |  |  | " Last Change: 2018-03-29 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " Filenames:   *.fs,*.ft | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | " URL:	       https://github.com/jkotlinski/forth.vim | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  | " quit when a syntax file was already loaded | 
					
						
							|  |  |  |  | if exists("b:current_syntax") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  |     finish | 
					
						
							|  |  |  |  | endif | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-10 14:55:01 +01:00
										 |  |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  |  | set cpo&vim | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " Synchronization method | 
					
						
							| 
									
										
										
										
											2004-07-10 09:47:34 +00:00
										 |  |  |  | syn sync ccomment | 
					
						
							|  |  |  |  | syn sync maxlines=200 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " I use gforth, so I set this to case ignore | 
					
						
							|  |  |  |  | syn case ignore | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " Some special, non-FORTH keywords | 
					
						
							|  |  |  |  | syn keyword forthTodo contained TODO FIXME XXX | 
					
						
							|  |  |  |  | syn match forthTodo contained 'Copyright\(\s([Cc])\)\=\(\s[0-9]\{2,4}\)\=' | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " Characters allowed in keywords | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | " I don't know if 128-255 are allowed in ANS-FORTH | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  | setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-24 21:16:56 +00:00
										 |  |  |  | " when wanted, highlight trailing white space | 
					
						
							|  |  |  |  | if exists("forth_space_errors") | 
					
						
							|  |  |  |  |     if !exists("forth_no_trail_space_error") | 
					
						
							|  |  |  |  |         syn match forthSpaceError display excludenl "\s\+$" | 
					
						
							|  |  |  |  |     endif | 
					
						
							|  |  |  |  |     if !exists("forth_no_tab_space_error") | 
					
						
							|  |  |  |  |         syn match forthSpaceError display " \+\t"me=e-1 | 
					
						
							|  |  |  |  |     endif | 
					
						
							|  |  |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " Keywords | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " basic mathematical and logical operators | 
					
						
							|  |  |  |  | syn keyword forthOperators + - * / MOD /MOD NEGATE ABS MIN MAX | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthOperators AND OR XOR NOT LSHIFT RSHIFT INVERT 2* 2/ 1+ | 
					
						
							|  |  |  |  | syn keyword forthOperators 1- 2+ 2- 8* UNDER+ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn keyword forthOperators M+ */ */MOD M* UM* M*/ UM/MOD FM/MOD SM/REM | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthOperators D+ D- DNEGATE DABS DMIN DMAX D2* D2/ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn keyword forthOperators F+ F- F* F/ FNEGATE FABS FMAX FMIN FLOOR FROUND | 
					
						
							|  |  |  |  | syn keyword forthOperators F** FSQRT FEXP FEXPM1 FLN FLNP1 FLOG FALOG FSIN | 
					
						
							|  |  |  |  | syn keyword forthOperators FCOS FSINCOS FTAN FASIN FACOS FATAN FATAN2 FSINH | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthOperators FCOSH FTANH FASINH FACOSH FATANH F2* F2/ 1/F | 
					
						
							|  |  |  |  | syn keyword forthOperators F~REL F~ABS F~ | 
					
						
							|  |  |  |  | syn keyword forthOperators 0< 0<= 0<> 0= 0> 0>= < <= <> = > >= U< U<= | 
					
						
							|  |  |  |  | syn keyword forthOperators U> U>= D0< D0<= D0<> D0= D0> D0>= D< D<= D<> | 
					
						
							|  |  |  |  | syn keyword forthOperators D= D> D>= DU< DU<= DU> DU>= WITHIN ?NEGATE | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthOperators ?DNEGATE TRUE FALSE | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " various words that take an input and do something with it | 
					
						
							|  |  |  |  | syn keyword forthFunction . U. .R U.R | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " stack manipulations | 
					
						
							|  |  |  |  | syn keyword forthStack DROP NIP DUP OVER TUCK SWAP ROT -ROT ?DUP PICK ROLL | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthStack 2DROP 2NIP 2DUP 2OVER 2TUCK 2SWAP 2ROT 2-ROT | 
					
						
							|  |  |  |  | syn keyword forthStack 3DUP 4DUP 5DUP 3DROP 4DROP 5DROP 8DROP 4SWAP 4ROT | 
					
						
							|  |  |  |  | syn keyword forthStack 4-ROT 4TUCK 8SWAP 8DUP | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn keyword forthRStack >R R> R@ RDROP 2>R 2R> 2R@ 2RDROP | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthRstack 4>R 4R> 4R@ 4RDROP | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn keyword forthFStack FDROP FNIP FDUP FOVER FTUCK FSWAP FROT | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " stack pointer manipulations | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP! DEPTH | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " address operations | 
					
						
							|  |  |  |  | syn keyword forthMemory @ ! +! C@ C! 2@ 2! F@ F! SF@ SF! DF@ DF! | 
					
						
							|  |  |  |  | syn keyword forthAdrArith CHARS CHAR+ CELLS CELL+ CELL ALIGN ALIGNED FLOATS | 
					
						
							|  |  |  |  | syn keyword forthAdrArith FLOAT+ FLOAT FALIGN FALIGNED SFLOATS SFLOAT+ | 
					
						
							|  |  |  |  | syn keyword forthAdrArith SFALIGN SFALIGNED DFLOATS DFLOAT+ DFALIGN DFALIGNED | 
					
						
							|  |  |  |  | syn keyword forthAdrArith MAXALIGN MAXALIGNED CFALIGN CFALIGNED | 
					
						
							|  |  |  |  | syn keyword forthAdrArith ADDRESS-UNIT-BITS ALLOT ALLOCATE HERE | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK UNUSED | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " conditionals | 
					
						
							|  |  |  |  | syn keyword forthCond IF ELSE ENDIF THEN CASE OF ENDOF ENDCASE ?DUP-IF | 
					
						
							|  |  |  |  | syn keyword forthCond ?DUP-0=-IF AHEAD CS-PICK CS-ROLL CATCH THROW WITHIN | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " iterations | 
					
						
							|  |  |  |  | syn keyword forthLoop BEGIN WHILE REPEAT UNTIL AGAIN | 
					
						
							|  |  |  |  | syn keyword forthLoop ?DO LOOP I J K +DO U+DO -DO U-DO DO +LOOP -LOOP | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT RECURSE | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " new words | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn match forthClassDef '\<:class\s*[^ \t]\+\>' | 
					
						
							|  |  |  |  | syn match forthObjectDef '\<:object\s*[^ \t]\+\>' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn match forthColonDef '\<:m\?\s*[^ \t]\+\>' | 
					
						
							|  |  |  |  | syn keyword forthEndOfColonDef ; ;M ;m | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthEndOfClassDef ;class | 
					
						
							|  |  |  |  | syn keyword forthEndOfObjectDef ;object | 
					
						
							|  |  |  |  | syn keyword forthDefine CONSTANT 2CONSTANT FCONSTANT VARIABLE 2VARIABLE | 
					
						
							|  |  |  |  | syn keyword forthDefine FVARIABLE CREATE USER VALUE TO DEFER IS DOES> IMMEDIATE | 
					
						
							|  |  |  |  | syn keyword forthDefine COMPILE-ONLY COMPILE RESTRICT INTERPRET POSTPONE EXECUTE | 
					
						
							|  |  |  |  | syn keyword forthDefine LITERAL CREATE-INTERPRET/COMPILE INTERPRETATION> | 
					
						
							|  |  |  |  | syn keyword forthDefine <INTERPRETATION COMPILATION> <COMPILATION ] LASTXT | 
					
						
							|  |  |  |  | syn keyword forthDefine COMP' POSTPONE, FIND-NAME NAME>INT NAME?INT NAME>COMP | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthDefine NAME>STRING STATE C; CVARIABLE BUFFER: MARKER | 
					
						
							|  |  |  |  | syn keyword forthDefine , 2, F, C, COMPILE, | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn match forthDefine "\[IFDEF]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[IFUNDEF]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[THEN]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[ENDIF]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[ELSE]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[?DO]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[DO]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[LOOP]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[+LOOP]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[NEXT]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[BEGIN]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[UNTIL]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[AGAIN]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[WHILE]" | 
					
						
							|  |  |  |  | syn match forthDefine "\[REPEAT]" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn match forthDefine "\[COMP']" | 
					
						
							|  |  |  |  | syn match forthDefine "'" | 
					
						
							|  |  |  |  | syn match forthDefine '\<\[\>' | 
					
						
							|  |  |  |  | syn match forthDefine "\[']" | 
					
						
							|  |  |  |  | syn match forthDefine '\[COMPILE]' | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn match forthDefine '\[CHAR]' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " debugging | 
					
						
							|  |  |  |  | syn keyword forthDebug PRINTDEBUGDATA PRINTDEBUGLINE | 
					
						
							|  |  |  |  | syn match forthDebug "\<\~\~\>" | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " Assembler | 
					
						
							|  |  |  |  | syn keyword forthAssembler ASSEMBLER CODE END-CODE ;CODE FLUSH-ICACHE C, | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " basic character operations | 
					
						
							|  |  |  |  | syn keyword forthCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthCharOps KEY? TIB CR BL COUNT SPACE SPACES | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " recognize 'char (' or '[char] (' correctly, so it doesn't | 
					
						
							|  |  |  |  | " highlight everything after the paren as a comment till a closing ')' | 
					
						
							|  |  |  |  | syn match forthCharOps '\<char\s\S\s' | 
					
						
							|  |  |  |  | syn match forthCharOps '\<\[char\]\s\S\s' | 
					
						
							|  |  |  |  | syn region forthCharOps start=+."\s+ skip=+\\"+ end=+"+ | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " char-number conversion | 
					
						
							| 
									
										
										
										
											2012-01-10 14:55:01 +01:00
										 |  |  |  | syn keyword forthConversion <<# <# # #> #>> #S (NUMBER) (NUMBER?) CONVERT D>F | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthConversion D>S DIGIT DPL F>D HLD HOLD NUMBER S>D SIGN >NUMBER | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthConversion F>S S>F HOLDS | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-29 15:11:47 +02:00
										 |  |  |  | " interpreter, wordbook, compiler | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn keyword forthForth (LOCAL) BYE COLD ABORT >BODY >NEXT >LINK CFA >VIEW HERE | 
					
						
							|  |  |  |  | syn keyword forthForth PAD WORDS VIEW VIEW> N>LINK NAME> LINK> L>NAME FORGET | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthForth BODY> ASSERT( ASSERT0( ASSERT1( ASSERT2( ASSERT3( ) | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthForth >IN ACCEPT ENVIRONMENT? EVALUATE QUIT SOURCE ACTION-OF | 
					
						
							|  |  |  |  | syn keyword forthForth DEFER! DEFER@ PARSE PARSE-NAME REFILL RESTORE-INPUT | 
					
						
							|  |  |  |  | syn keyword forthForth SAVE-INPUT SOURCE-ID | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | syn region forthForth start=+ABORT"\s+ skip=+\\"+ end=+"+ | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | " vocabularies | 
					
						
							|  |  |  |  | syn keyword forthVocs ONLY FORTH ALSO ROOT SEAL VOCS ORDER CONTEXT #VOCS | 
					
						
							|  |  |  |  | syn keyword forthVocs VOCABULARY DEFINITIONS | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | " File keywords | 
					
						
							| 
									
										
										
										
											2012-01-10 14:55:01 +01:00
										 |  |  |  | syn keyword forthFileMode R/O R/W W/O BIN | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthFileWords OPEN-FILE CREATE-FILE CLOSE-FILE DELETE-FILE | 
					
						
							|  |  |  |  | syn keyword forthFileWords RENAME-FILE READ-FILE READ-LINE KEY-FILE | 
					
						
							|  |  |  |  | syn keyword forthFileWords KEY?-FILE WRITE-FILE WRITE-LINE EMIT-FILE | 
					
						
							|  |  |  |  | syn keyword forthFileWords FLUSH-FILE FILE-STATUS FILE-POSITION | 
					
						
							|  |  |  |  | syn keyword forthFileWords REPOSITION-FILE FILE-SIZE RESIZE-FILE | 
					
						
							|  |  |  |  | syn keyword forthFileWords SLURP-FILE SLURP-FID STDIN STDOUT STDERR | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthFileWords INCLUDE-FILE INCLUDED REQUIRED | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn keyword forthBlocks OPEN-BLOCKS USE LOAD --> BLOCK-OFFSET | 
					
						
							|  |  |  |  | syn keyword forthBlocks GET-BLOCK-FID BLOCK-POSITION LIST SCR BLOCK | 
					
						
							|  |  |  |  | syn keyword forthBlocks BUFER EMPTY-BUFFERS EMPTY-BUFFER UPDATE UPDATED? | 
					
						
							|  |  |  |  | syn keyword forthBlocks SAVE-BUFFERS SAVE-BUFFER FLUSH THRU +LOAD +THRU | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn keyword forthBlocks BLOCK-INCLUDED BLK | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " numbers | 
					
						
							|  |  |  |  | syn keyword forthMath DECIMAL HEX BASE | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn match forthInteger '\<-\=[0-9]\+.\=\>' | 
					
						
							|  |  |  |  | syn match forthInteger '\<&-\=[0-9]\+.\=\>' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " recognize hex and binary numbers, the '$' and '%' notation is for gforth | 
					
						
							|  |  |  |  | syn match forthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess | 
					
						
							|  |  |  |  | syn match forthInteger '\<\x*\d\x*\>'  " *2* --- this order! | 
					
						
							|  |  |  |  | syn match forthInteger '\<%[0-1]*[0-1]\+\>' | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe]\d\+\>' | 
					
						
							|  |  |  |  | syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe][-+]\d\+\>' | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | " XXX If you find this overkill you can remove it. this has to come after the | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | " highlighting for numbers otherwise it has no effect. | 
					
						
							|  |  |  |  | syn region forthComment start='0 \[if\]' end='\[endif\]' end='\[then\]' contains=forthTodo | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " Strings | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn region forthString start=+\.*\"+ end=+"+ end=+$+ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " XXX | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn region forthString start=+s\"+ end=+"+ end=+$+ | 
					
						
							|  |  |  |  | syn region forthString start=+s\\\"+ end=+"+ end=+$+ | 
					
						
							|  |  |  |  | syn region forthString start=+c\"+ end=+"+ end=+$+ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " Comments | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn match forthComment '\\\s.*$' contains=forthTodo,forthSpaceError | 
					
						
							|  |  |  |  | syn region forthComment start='\\S\s' end='.*' contains=forthTodo,forthSpaceError | 
					
						
							|  |  |  |  | syn match forthComment '\.(\s[^)]*)' contains=forthTodo,forthSpaceError | 
					
						
							|  |  |  |  | syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=forthTodo,forthSpaceError | 
					
						
							|  |  |  |  | syn region forthComment start='/\*' end='\*/' contains=forthTodo,forthSpaceError | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | " Include files | 
					
						
							|  |  |  |  | syn match forthInclude '^INCLUDE\s\+\k\+' | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | syn match forthInclude '^REQUIRE\s\+\k\+' | 
					
						
							|  |  |  |  | syn match forthInclude '^FLOAD\s\+' | 
					
						
							|  |  |  |  | syn match forthInclude '^NEEDS\s\+' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |  | " Locals definitions | 
					
						
							|  |  |  |  | syn region forthLocals start='{\s' start='{$' end='\s}' end='^}' | 
					
						
							|  |  |  |  | syn match forthLocals '{ }' " otherwise, at least two spaces between | 
					
						
							|  |  |  |  | syn region forthDeprecated start='locals|' end='|' | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " Define the default highlighting. | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  | hi def link forthTodo Todo | 
					
						
							|  |  |  |  | hi def link forthOperators Operator | 
					
						
							|  |  |  |  | hi def link forthMath Number | 
					
						
							|  |  |  |  | hi def link forthInteger Number | 
					
						
							|  |  |  |  | hi def link forthFloat Float | 
					
						
							|  |  |  |  | hi def link forthStack Special | 
					
						
							|  |  |  |  | hi def link forthRstack Special | 
					
						
							|  |  |  |  | hi def link forthFStack Special | 
					
						
							|  |  |  |  | hi def link forthSP Special | 
					
						
							|  |  |  |  | hi def link forthMemory Function | 
					
						
							|  |  |  |  | hi def link forthAdrArith Function | 
					
						
							|  |  |  |  | hi def link forthMemBlks Function | 
					
						
							|  |  |  |  | hi def link forthCond Conditional | 
					
						
							|  |  |  |  | hi def link forthLoop Repeat | 
					
						
							|  |  |  |  | hi def link forthColonDef Define | 
					
						
							|  |  |  |  | hi def link forthEndOfColonDef Define | 
					
						
							|  |  |  |  | hi def link forthDefine Define | 
					
						
							|  |  |  |  | hi def link forthDebug Debug | 
					
						
							|  |  |  |  | hi def link forthAssembler Include | 
					
						
							|  |  |  |  | hi def link forthCharOps Character | 
					
						
							|  |  |  |  | hi def link forthConversion String | 
					
						
							|  |  |  |  | hi def link forthForth Statement | 
					
						
							|  |  |  |  | hi def link forthVocs Statement | 
					
						
							|  |  |  |  | hi def link forthString String | 
					
						
							|  |  |  |  | hi def link forthComment Comment | 
					
						
							|  |  |  |  | hi def link forthClassDef Define | 
					
						
							|  |  |  |  | hi def link forthEndOfClassDef Define | 
					
						
							|  |  |  |  | hi def link forthObjectDef Define | 
					
						
							|  |  |  |  | hi def link forthEndOfObjectDef Define | 
					
						
							|  |  |  |  | hi def link forthInclude Include | 
					
						
							|  |  |  |  | hi def link forthLocals Type " nothing else uses type and locals must stand out | 
					
						
							|  |  |  |  | hi def link forthDeprecated Error " if you must, change to Type | 
					
						
							|  |  |  |  | hi def link forthFileMode Function | 
					
						
							| 
									
										
										
										
											2018-03-30 12:27:32 +02:00
										 |  |  |  | hi def link forthFunction Function | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  | hi def link forthFileWords Statement | 
					
						
							|  |  |  |  | hi def link forthBlocks Statement | 
					
						
							|  |  |  |  | hi def link forthSpaceError Error | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | let b:current_syntax = "forth" | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-10 14:55:01 +01:00
										 |  |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  |  | unlet s:cpo_save | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |  | " vim:ts=8:sw=4:nocindent:smartindent: |