codekingpro/portable-devtools
114k
1" Copyright (C) 2021 Matthew T. Ihlenfield.2"3" This program is free software: you can redistribute it and/or modify4" it under the terms of the GNU General Public License as published by5" the Free Software Foundation, either version 3 of the License, or6" (at your option) any later version.7"8" This program is distributed in the hope that it will be useful,9" but WITHOUT ANY WARRANTY; without even the implied warranty of10" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11" GNU General Public License for more details.12"13" You should have received a copy of the GNU General Public License14" along with this program. If not, see <http://www.gnu.org/licenses/>.15"16" Vim syntax file17" Language: Poke18" Maintainer: Matt Ihlenfield <mtihlenfield@protonmail.com>19" Filenames: *.pk20" Latest Revision: 10 March 202121 22if exists('b:current_syntax')23 finish24endif25 26" Poke statement27syn keyword pokeStatement assert break continue return28syn keyword pokeStatement type unit fun method nextgroup=pokeFunction skipwhite29syn keyword pokeStatement var nextgroup=pokeVar skipWhite30 31" Identifiers32syn match pokeVar '\h\w*' display contained33 34" User defined functions35syn match pokeFunction '\h\w*' display contained36 37" Poke operators38syn keyword pokeOperator in sizeof as isa unmap39 40" Conditionals41syn keyword pokeConditional if else where42 43" Structures, unions, etc...44syn keyword pokeStructure struct union pinned45 46" Loops47syn keyword pokeRepeat while for48 49" Imports50syn keyword pokeLoad load51 52" Exceptions53syn keyword pokeException try catch until raise54 55" Exception types56syn keyword pokeExceptionType Exception E_generic E_out_of_bounds57syn keyword pokeExceptionType E_eof E_elem E_constraint58syn keyword pokeExceptionType E_conv E_map_bounds E_map59syn keyword pokeExceptionType E_div_by_zero E_no_ios E_no_return60syn keyword pokeExceptionType E_io E_io_flags E_assert E_overflow61 62" Exception codes63syn keyword pokeExceptionCode EC_generic EC_out_of_bounds64syn keyword pokeExceptionCode EC_eof EC_elem EC_constraint65syn keyword pokeExceptionCode EC_conv EC_map_bounds EC_map66syn keyword pokeExceptionCode EC_div_by_zero EC_no_ios EC_no_return67syn keyword pokeExceptionCode EC_io EC_io_flags EC_assert EC_overflow68 69" Poke builtin types70syn keyword pokeBuiltinType string void int uint bit nibble71syn keyword pokeBuiltinType byte char ushort short ulong long72syn keyword pokeBuiltinType uint8 uint16 uint32 uint6473syn keyword pokeBuiltinType off64 uoff64 offset74syn keyword pokeBuiltinType Comparator POSIX_Time32 POSIX_Time6475syn keyword pokeBuiltinType big little any76 77" Poke constants78syn keyword pokeConstant ENDIAN_LITTLE ENDIAN_BIG79syn keyword pokeConstant IOS_F_READ IOS_F_WRITE IOS_F_TRUNCATE IOS_F_CREATE80syn keyword pokeConstant IOS_M_RDONLY IOS_M_WRONLY IOS_M_RDWR81syn keyword pokeConstant load_path NULL OFFSET82 83" Poke std lib84syn keyword pokeBuiltinFunction print printf catos stoca atoi ltos reverse85syn keyword pokeBuiltinFunction ltrim rtrim strchr qsort crc32 alignto86syn keyword pokeBuiltinFunction open close flush get_ios set_ios iosize87syn keyword pokeBuiltinFunction rand get_endian set_endian strace exit88syn keyword pokeBuiltinFunction getenv89 90" Formats91 92" Special chars93syn match pokeSpecial "\\\([nt\\]\|\o\{1,3}\)" display contained94 95" Chars96syn match pokeChar "'[^']*'" contains=pokeSpecial97 98" Attributes99syn match pokeAttribute "\h\w*'\h\w"100 101" Strings102syn region pokeString skip=+\\\\\|\\"+ start=+"+ end=+"+ contains=pokeSpecial103 104" Integer literals105syn match pokeInteger "\<\d\+_*\d*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"106syn match pokeInteger "\<0[Xx]\x\+_*\x*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"107syn match pokeInteger "\<0[Oo]\o\+_*\o*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"108syn match pokeInteger "\<0[Bb][01]\+_*[01]*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"109 110" Units111syn keyword pokeBuiltinUnit b M B112syn keyword pokeBuiltinUnit Kb KB Mb MB Gb GB113syn keyword pokeBuiltinUnit Kib KiB Mib MiB Gib GiB114 115" Offsets116syn match pokeOffset "#\h\w*" contains=pokeBuiltinUnit117 118" Comments119syn keyword pokeCommentTodo TODO FIXME XXX TBD contained120syn match pokeLineComment "\/\/.*" contains=pokeCommentTodo,@Spell extend121syn region pokeComment start="/\*" end="\*/" contains=pokeCommentTodo,@Spell fold extend122 123" Allow folding of blocks124syn region pokeBlock start="{" end="}" transparent fold125 126" Highlight groups127hi def link pokeBuiltinFunction Function128hi def link pokeBuiltinType Type129hi def link pokeBuiltinUnit Keyword130hi def link pokeChar Character131hi def link pokeComment Comment132hi def link pokeCommentTodo Todo133hi def link pokeConditional Conditional134hi def link pokeConstant Constant135hi def link pokeException Exception136hi def link pokeExceptionCode Constant137hi def link pokeExceptionType Type138hi def link pokeFunction Function139hi def link pokeInteger Number140hi def link pokeLineComment Comment141hi def link pokeLoad Include142hi def link pokeOffset StorageClass143hi def link pokeOperator Operator144hi def link pokeSpecial SpecialChar145hi def link pokeStatement Statement146hi def link pokeString String147hi def link pokeStructure Structure148hi def link pokeRepeat Repeat149hi def link pokeVar Identifier150 151let b:current_syntax = 'poke'152 