aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-02 10:24:39 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-02 10:33:32 -0400
commiteea3a692c652ba6d4db868cd4f3cfdebb0f65861 (patch)
tree37c2480a5471848623b64ca579611cadb97956eb /runtime/syntax
parent6a8436065ca7282569fd4d96b1c02a8ba8eaacf1 (diff)
downloadrneovim-eea3a692c652ba6d4db868cd4f3cfdebb0f65861.tar.gz
rneovim-eea3a692c652ba6d4db868cd4f3cfdebb0f65861.tar.bz2
rneovim-eea3a692c652ba6d4db868cd4f3cfdebb0f65861.zip
vim-patch:c8cdf0f80b3c
Update runtime files. https://github.com/vim/vim/commit/c8cdf0f80b3cfd88a4490d80572062c1fd1a96ca
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/html.vim69
-rw-r--r--runtime/syntax/poke.vim151
2 files changed, 176 insertions, 44 deletions
diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim
index 36d3c25f3a..8ccb5574e7 100644
--- a/runtime/syntax/html.vim
+++ b/runtime/syntax/html.vim
@@ -3,8 +3,9 @@
" Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
-" Last Change: 2021 Feb 25
+" Last Change: 2021 Mar 02
" Included patch #7900 to fix comments
+" Included patch #7916 to fix a few more things
"
" Please check :help html.vim for some comments and a description of the options
@@ -79,26 +80,16 @@ syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
" aria attributes
-syn match htmlArg contained "\<\(aria-activedescendant\|aria-atomic\)\>"
-syn match htmlArg contained "\<\(aria-autocomplete\|aria-busy\|aria-checked\)\>"
-syn match htmlArg contained "\<\(aria-colcount\|aria-colindex\|aria-colspan\)\>"
-syn match htmlArg contained "\<\(aria-controls\|aria-current\)\>"
-syn match htmlArg contained "\<\(aria-describedby\|aria-details\)\>"
-syn match htmlArg contained "\<\(aria-disabled\|aria-dropeffect\)\>"
-syn match htmlArg contained "\<\(aria-errormessage\|aria-expanded\)\>"
-syn match htmlArg contained "\<\(aria-flowto\|aria-grabbed\|aria-haspopup\)\>"
-syn match htmlArg contained "\<\(aria-hidden\|aria-invalid\)\>"
-syn match htmlArg contained "\<\(aria-keyshortcuts\|aria-label\)\>"
-syn match htmlArg contained "\<\(aria-labelledby\|aria-level\|aria-live\)\>"
-syn match htmlArg contained "\<\(aria-modal\|aria-multiline\)\>"
-syn match htmlArg contained "\<\(aria-multiselectable\|aria-orientation\)\>"
-syn match htmlArg contained "\<\(aria-owns\|aria-placeholder\|aria-posinset\)\>"
-syn match htmlArg contained "\<\(aria-pressed\|aria-readonly\|aria-relevant\)\>"
-syn match htmlArg contained "\<\(aria-required\|aria-roledescription\)\>"
-syn match htmlArg contained "\<\(aria-rowcount\|aria-rowindex\|aria-rowspan\)\>"
-syn match htmlArg contained "\<\(aria-selected\|aria-setsize\|aria-sort\)\>"
-syn match htmlArg contained "\<\(aria-valuemax\|aria-valuemin\)\>"
-syn match htmlArg contained "\<\(aria-valuenow\|aria-valuetext\)\>"
+exe 'syn match htmlArg contained "\<aria-\%(' . join([
+ \ 'activedescendant', 'atomic', 'autocomplete', 'busy', 'checked', 'colcount',
+ \ 'colindex', 'colspan', 'controls', 'current', 'describedby', 'details',
+ \ 'disabled', 'dropeffect', 'errormessage', 'expanded', 'flowto', 'grabbed',
+ \ 'haspopup', 'hidden', 'invalid', 'keyshortcuts', 'label', 'labelledby', 'level',
+ \ 'live', 'modal', 'multiline', 'multiselectable', 'orientation', 'owns',
+ \ 'placeholder', 'posinset', 'pressed', 'readonly', 'relevant', 'required',
+ \ 'roledescription', 'rowcount', 'rowindex', 'rowspan', 'selected', 'setsize',
+ \ 'sort', 'valuemax', 'valuemin', 'valuenow', 'valuetext'
+ \ ], '\|') . '\)\>"'
syn keyword htmlArg contained role
" Netscape extensions
@@ -139,25 +130,19 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
" Comments (the real ones or the old netscape ones)
if exists("html_wrong_comments")
- syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
+ syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
else
- " The HTML 5.2 syntax 8.2.4.41-42: bogus comment is parser error; browser skips until next &gt;
- " Note: must stand first to get lesser :syn-priority
- syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError
- " Normal comment opening <!-- ...>
- syn region htmlComment start=+<!--+ end=+>+ contains=htmlCommentPart,@Spell
- " Idem 8.2.4.43-44: <!--> and <!---> are parser errors; browser treats as comments
- syn match htmlComment "<!---\?>" contains=htmlCommentError
- " Idem 8.2.4.51: any number of consecutive dashes within comment is okay; --> closes comment
- " Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment
- syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell
- " Idem 8.2.4.49: opening nested comment <!-- is parser error, ignored by browser, except <!--> is all right
- syn match htmlCommentNested contained "<!--[^>]"me=e-1
- syn match htmlCommentNested contained "<!--->"me=e-3
- syn match htmlCommentNested contained "<!---\?!>"me=e-4
- syn match htmlCommentError contained "[^><!]"
+ " The HTML 5.2 syntax 8.2.4.41: bogus comment is parser error; browser skips until next &gt
+ syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError keepend
+ " Idem 8.2.4.42,51: Comment starts with <!-- and ends with -->
+ " Idem 8.2.4.43,44: Except <!--> and <!---> are parser errors
+ " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment
+ syn region htmlComment matchgroup=htmlComment start=+<!--\%(-\?>\)\@!+ end=+--!\?>+ contains=htmlCommentNested,@htmlPreProc,@Spell keepend
+ " Idem 8.2.4.49: nested comment is parser error, except <!--> is all right
+ syn match htmlCommentNested contained "<!-->\@!"
+ syn match htmlCommentError contained "[^><!]"
endif
-syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
+syn region htmlComment start=+<!DOCTYPE+ end=+>+ keepend
" server-parsed commands
syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
@@ -278,7 +263,7 @@ hi def link htmlEndTag Identifier
hi def link htmlArg Type
hi def link htmlTagName htmlStatement
hi def link htmlSpecialTagName Exception
-hi def link htmlValue String
+hi def link htmlValue String
hi def link htmlSpecialChar Special
if !exists("html_no_rendering")
@@ -322,14 +307,10 @@ hi def link htmlPreProc PreProc
hi def link htmlPreAttr String
hi def link htmlPreProcAttrName PreProc
hi def link htmlPreProcAttrError Error
-hi def link htmlSpecial Special
-hi def link htmlSpecialChar Special
hi def link htmlString String
hi def link htmlStatement Statement
hi def link htmlComment Comment
-hi def link htmlCommentPart Comment
-hi def link htmlValue String
-hi def link htmlCommentNested htmlCommentError
+hi def link htmlCommentNested htmlError
hi def link htmlCommentError htmlError
hi def link htmlTagError htmlError
hi def link htmlEvent javaScript
diff --git a/runtime/syntax/poke.vim b/runtime/syntax/poke.vim
new file mode 100644
index 0000000000..4a07a77d6c
--- /dev/null
+++ b/runtime/syntax/poke.vim
@@ -0,0 +1,151 @@
+" Copyright (C) 2021 Matthew T. Ihlenfield.
+"
+" This program is free software: you can redistribute it and/or modify
+" it under the terms of the GNU General Public License as published by
+" the Free Software Foundation, either version 3 of the License, or
+" (at your option) any later version.
+"
+" This program is distributed in the hope that it will be useful,
+" but WITHOUT ANY WARRANTY; without even the implied warranty of
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+" GNU General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License
+" along with this program. If not, see <http://www.gnu.org/licenses/>.
+"
+" Vim syntax file
+" Language: Poke
+" Maintainer: Matt Ihlenfield <mtihlenfield@protonmail.com>
+" Filenames: *.pk
+" Latest Revision: 10 March 2021
+
+if exists('b:current_syntax')
+ finish
+endif
+
+" Poke statement
+syn keyword pokeStatement assert break continue return
+syn keyword pokeStatement type unit fun method nextgroup=pokeFunction skipwhite
+syn keyword pokeStatement var nextgroup=pokeVar skipWhite
+
+" Identifiers
+syn match pokeVar '\h\w*' display contained
+
+" User defined functions
+syn match pokeFunction '\h\w*' display contained
+
+" Poke operators
+syn keyword pokeOperator in sizeof as isa unmap
+
+" Conditionals
+syn keyword pokeConditional if else where
+
+" Structures, unions, etc...
+syn keyword pokeStructure struct union pinned
+
+" Loops
+syn keyword pokeRepeat while for
+
+" Imports
+syn keyword pokeLoad load
+
+" Exceptions
+syn keyword pokeException try catch until raise
+
+" Exception types
+syn keyword pokeExceptionType Exception E_generic E_out_of_bounds
+syn keyword pokeExceptionType E_eof E_elem E_constraint
+syn keyword pokeExceptionType E_conv E_map_bounds E_map
+syn keyword pokeExceptionType E_div_by_zero E_no_ios E_no_return
+syn keyword pokeExceptionType E_io E_io_flags E_assert E_overflow
+
+" Exception codes
+syn keyword pokeExceptionCode EC_generic EC_out_of_bounds
+syn keyword pokeExceptionCode EC_eof EC_elem EC_constraint
+syn keyword pokeExceptionCode EC_conv EC_map_bounds EC_map
+syn keyword pokeExceptionCode EC_div_by_zero EC_no_ios EC_no_return
+syn keyword pokeExceptionCode EC_io EC_io_flags EC_assert EC_overflow
+
+" Poke builtin types
+syn keyword pokeBuiltinType string void int uint bit nibble
+syn keyword pokeBuiltinType byte char ushort short ulong long
+syn keyword pokeBuiltinType uint8 uint16 uint32 uint64
+syn keyword pokeBuiltinType off64 uoff64 offset
+syn keyword pokeBuiltinType Comparator POSIX_Time32 POSIX_Time64
+syn keyword pokeBuiltinType big little any
+
+" Poke constants
+syn keyword pokeConstant ENDIAN_LITTLE ENDIAN_BIG
+syn keyword pokeConstant IOS_F_READ IOS_F_WRITE IOS_F_TRUNCATE IOS_F_CREATE
+syn keyword pokeConstant IOS_M_RDONLY IOS_M_WRONLY IOS_M_RDWR
+syn keyword pokeConstant load_path NULL OFFSET
+
+" Poke std lib
+syn keyword pokeBuiltinFunction print printf catos stoca atoi ltos reverse
+syn keyword pokeBuiltinFunction ltrim rtrim strchr qsort crc32 alignto
+syn keyword pokeBuiltinFunction open close flush get_ios set_ios iosize
+syn keyword pokeBuiltinFunction rand get_endian set_endian strace exit
+syn keyword pokeBuiltinFunction getenv
+
+" Formats
+
+" Special chars
+syn match pokeSpecial "\\\([nt\\]\|\o\{1,3}\)" display contained
+
+" Chars
+syn match pokeChar "'[^']*'" contains=pokeSpecial
+
+" Attributes
+syn match pokeAttribute "\h\w*'\h\w"
+
+" Strings
+syn region pokeString skip=+\\\\\|\\"+ start=+"+ end=+"+ contains=pokeSpecial
+
+" Integer literals
+syn match pokeInteger "\<\d\+_*\d*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
+syn match pokeInteger "\<0[Xx]\x\+_*\x*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
+syn match pokeInteger "\<0[Oo]\o\+_*\o*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
+syn match pokeInteger "\<0[Bb][01]\+_*[01]*\([LlHhBbNn]\=[Uu]\=\|[Uu]\=[LlHhBbNn]\=\)\>"
+
+" Units
+syn keyword pokeBuiltinUnit b M B
+syn keyword pokeBuiltinUnit Kb KB Mb MB Gb GB
+syn keyword pokeBuiltinUnit Kib KiB Mib MiB Gib GiB
+
+" Offsets
+syn match pokeOffset "#\h\w*" contains=pokeBuiltinUnit
+
+" Comments
+syn keyword pokeCommentTodo TODO FIXME XXX TBD contained
+syn match pokeLineComment "\/\/.*" contains=pokeCommentTodo,@Spell extend
+syn region pokeComment start="/\*" end="\*/" contains=pokeCommentTodo,@Spell fold extend
+
+" Allow folding of blocks
+syn region pokeBlock start="{" end="}" transparent fold
+
+" Highlight groups
+hi def link pokeBuiltinFunction Function
+hi def link pokeBuiltinType Type
+hi def link pokeBuiltinUnit Keyword
+hi def link pokeChar Character
+hi def link pokeComment Comment
+hi def link pokeCommentTodo Todo
+hi def link pokeConditional Conditional
+hi def link pokeConstant Constant
+hi def link pokeException Exception
+hi def link pokeExceptionCode Constant
+hi def link pokeExceptionType Type
+hi def link pokeFunction Function
+hi def link pokeInteger Number
+hi def link pokeLineComment Comment
+hi def link pokeLoad Include
+hi def link pokeOffset StorageClass
+hi def link pokeOperator Operator
+hi def link pokeSpecial SpecialChar
+hi def link pokeStatement Statement
+hi def link pokeString String
+hi def link pokeStructure Structure
+hi def link pokeRepeat Repeat
+hi def link pokeVar Identifier
+
+let b:current_syntax = 'poke'