annotate runtime/syntax/poke.vim @ 31607:ff068ae8db41

Added tag v9.0.1135 for changeset 035b8dbb267c34612e772b95deb652265653cb60
author Bram Moolenaar <Bram@vim.org>
date Mon, 02 Jan 2023 21:45:04 +0100
parents 788e10cec9bd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24103
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Copyright (C) 2021 Matthew T. Ihlenfield.
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 "
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " This program is free software: you can redistribute it and/or modify
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " it under the terms of the GNU General Public License as published by
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " the Free Software Foundation, either version 3 of the License, or
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " (at your option) any later version.
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 "
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " This program is distributed in the hope that it will be useful,
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 " but WITHOUT ANY WARRANTY; without even the implied warranty of
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 " GNU General Public License for more details.
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 "
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 " You should have received a copy of the GNU General Public License
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 " along with this program. If not, see <http://www.gnu.org/licenses/>.
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 "
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 " Vim syntax file
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 " Language: Poke
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 " Maintainer: Matt Ihlenfield <mtihlenfield@protonmail.com>
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 " Filenames: *.pk
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 " Latest Revision: 10 March 2021
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 if exists('b:current_syntax')
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 finish
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 endif
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 " Poke statement
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 syn keyword pokeStatement assert break continue return
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 syn keyword pokeStatement type unit fun method nextgroup=pokeFunction skipwhite
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 syn keyword pokeStatement var nextgroup=pokeVar skipWhite
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 " Identifiers
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 syn match pokeVar '\h\w*' display contained
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 " User defined functions
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 syn match pokeFunction '\h\w*' display contained
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 " Poke operators
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 syn keyword pokeOperator in sizeof as isa unmap
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 " Conditionals
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 syn keyword pokeConditional if else where
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 " Structures, unions, etc...
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 syn keyword pokeStructure struct union pinned
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 " Loops
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 syn keyword pokeRepeat while for
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 " Imports
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 syn keyword pokeLoad load
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 " Exceptions
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 syn keyword pokeException try catch until raise
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 " Exception types
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 syn keyword pokeExceptionType Exception E_generic E_out_of_bounds
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 syn keyword pokeExceptionType E_eof E_elem E_constraint
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 syn keyword pokeExceptionType E_conv E_map_bounds E_map
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 syn keyword pokeExceptionType E_div_by_zero E_no_ios E_no_return
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 syn keyword pokeExceptionType E_io E_io_flags E_assert E_overflow
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 " Exception codes
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 syn keyword pokeExceptionCode EC_generic EC_out_of_bounds
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 syn keyword pokeExceptionCode EC_eof EC_elem EC_constraint
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 syn keyword pokeExceptionCode EC_conv EC_map_bounds EC_map
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 syn keyword pokeExceptionCode EC_div_by_zero EC_no_ios EC_no_return
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 syn keyword pokeExceptionCode EC_io EC_io_flags EC_assert EC_overflow
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 " Poke builtin types
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 syn keyword pokeBuiltinType string void int uint bit nibble
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 syn keyword pokeBuiltinType byte char ushort short ulong long
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 syn keyword pokeBuiltinType uint8 uint16 uint32 uint64
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 syn keyword pokeBuiltinType off64 uoff64 offset
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 syn keyword pokeBuiltinType Comparator POSIX_Time32 POSIX_Time64
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 syn keyword pokeBuiltinType big little any
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 " Poke constants
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 syn keyword pokeConstant ENDIAN_LITTLE ENDIAN_BIG
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 syn keyword pokeConstant IOS_F_READ IOS_F_WRITE IOS_F_TRUNCATE IOS_F_CREATE
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 syn keyword pokeConstant IOS_M_RDONLY IOS_M_WRONLY IOS_M_RDWR
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 syn keyword pokeConstant load_path NULL OFFSET
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 " Poke std lib
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 syn keyword pokeBuiltinFunction print printf catos stoca atoi ltos reverse
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 syn keyword pokeBuiltinFunction ltrim rtrim strchr qsort crc32 alignto
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 syn keyword pokeBuiltinFunction open close flush get_ios set_ios iosize
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 syn keyword pokeBuiltinFunction rand get_endian set_endian strace exit
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 syn keyword pokeBuiltinFunction getenv
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 " Formats
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 " Special chars
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 syn match pokeSpecial "\\\([nt\\]\|\o\{1,3}\)" display contained
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 " Chars
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 syn match pokeChar "'[^']*'" contains=pokeSpecial
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 " Attributes
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 syn match pokeAttribute "\h\w*'\h\w"
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 " Strings
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 syn region pokeString skip=+\\\\\|\\"+ start=+"+ end=+"+ contains=pokeSpecial
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 " Integer literals
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 syn match pokeInteger "\<\d\+_*\d*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 syn match pokeInteger "\<0[Xx]\x\+_*\x*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 syn match pokeInteger "\<0[Oo]\o\+_*\o*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 syn match pokeInteger "\<0[Bb][01]\+_*[01]*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 " Units
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 syn keyword pokeBuiltinUnit b M B
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 syn keyword pokeBuiltinUnit Kb KB Mb MB Gb GB
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 syn keyword pokeBuiltinUnit Kib KiB Mib MiB Gib GiB
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 " Offsets
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 syn match pokeOffset "#\h\w*" contains=pokeBuiltinUnit
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 " Comments
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 syn keyword pokeCommentTodo TODO FIXME XXX TBD contained
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 syn match pokeLineComment "\/\/.*" contains=pokeCommentTodo,@Spell extend
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 syn region pokeComment start="/\*" end="\*/" contains=pokeCommentTodo,@Spell fold extend
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 " Allow folding of blocks
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 syn region pokeBlock start="{" end="}" transparent fold
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 " Highlight groups
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 hi def link pokeBuiltinFunction Function
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 hi def link pokeBuiltinType Type
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 hi def link pokeBuiltinUnit Keyword
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 hi def link pokeChar Character
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 hi def link pokeComment Comment
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 hi def link pokeCommentTodo Todo
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 hi def link pokeConditional Conditional
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 hi def link pokeConstant Constant
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 hi def link pokeException Exception
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136 hi def link pokeExceptionCode Constant
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 hi def link pokeExceptionType Type
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138 hi def link pokeFunction Function
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 hi def link pokeInteger Number
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 hi def link pokeLineComment Comment
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141 hi def link pokeLoad Include
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 hi def link pokeOffset StorageClass
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 hi def link pokeOperator Operator
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 hi def link pokeSpecial SpecialChar
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 hi def link pokeStatement Statement
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 hi def link pokeString String
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 hi def link pokeStructure Structure
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 hi def link pokeRepeat Repeat
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 hi def link pokeVar Identifier
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150
788e10cec9bd Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151 let b:current_syntax = 'poke'