annotate runtime/syntax/openscad.vim @ 32728:b13f723a7ec6 v9.0.1684

patch 9.0.1684: Update libvterm to rev 839 Commit: https://github.com/vim/vim/commit/b00df7aa388994119346a21d77b0d0db2a0a5e9f Author: zeertzjq <zeertzjq@outlook.com> Date: Tue Aug 8 11:03:00 2023 +0800 patch 9.0.1684: Update libvterm to rev 839 Problem: libvterm slightly outdated Solution: Update libvterm from rev 818 to rev 839 Notable fix: libvterm now handles DECSM/DECRM with multiple arguents, so several ncurses programs (e.g. nnn) can enable mouse properly when run in Vim's terminal in XTerm. closes: #12746 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Fri, 11 Aug 2023 21:30:03 +0200
parents f73a9bdff3a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28517
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: OpenSCAD
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Niklas Adam <adam@oddodd.org>
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Last change: 2022-04-15
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 "
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 "
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " From salkin-mada/openscad.nvim
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " Building on the work of Sirtaj Singh Kang and others for vim-openscad
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 "
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 " quit when a syntax file was already loaded
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 if exists("b:current_syntax")
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 finish
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 endif
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 syntax case ignore
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 setlocal iskeyword=a-z,A-Z,48-57,_
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 syn match openscadAoperator "{"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 syn match openscadAoperator "}"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn match openscadLi "\["
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 syn match openscadLi "\]"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 syn match openscadPar "("
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 syn match openscadPar ")"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 syn match openscadSpecialVariable "\$[a-zA-Z_]\+\>" display
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 syn match openscadModifier "^\s*[\*\!\#\%]" display
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 syn match openscadBinaryoperator "+"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 syn match openscadBinaryoperator "-"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 syn match openscadBinaryoperator "*"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 syn match openscadBinaryoperator "/"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 syn match openscadBinaryoperator "%"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 syn match openscadBinaryoperator "\*\*"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 syn match openscadBinaryoperator "<"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 syn match openscadBinaryoperator "<="
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 syn match openscadBinaryoperator ">"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 syn match openscadBinaryoperator ">="
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 syn match openscadBinaryoperator "="
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 syn match openscadBinaryoperator "=="
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 syn match openscadBinaryoperator "==="
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 syn match openscadBinaryoperator "!="
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 syn match openscadBinaryoperator "!=="
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 syn match openscadBinaryoperator "&"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 syn match openscadBinaryoperator "|"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 syn match openscadBinaryoperator "<!"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 syn match openscadBinaryoperator "?"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 syn match openscadBinaryoperator "??"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 syn match openscadBinaryoperator "!?"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 syn match openscadBinaryoperator "!"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 syn match openscadBinaryoperator "#"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 syn match openscadBinaryoperator "_"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 syn match openscadBinaryoperator "\.\."
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 syn match openscadBinaryoperator "\.\.\."
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 syn match openscadBinaryoperator "`"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 syn match openscadBinaryoperator ":"
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 syn keyword openscadFunctionDef function nextgroup=openscadFunction skipwhite skipempty
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 syn match openscadFunction /\<\h\w*\>/ contained display
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 syn keyword openscadModuleDef module nextgroup=openscadModule skipwhite skipempty
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 syn match openscadModule /\<\h\w*\>/ contained display
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 syn keyword openscadStatement echo assign let assert
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 syn keyword openscadConditional if else
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 syn keyword openscadRepeat for intersection_for
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 syn keyword openscadInclude include use
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 syn keyword openscadCsgKeyword union difference intersection render intersection_for
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 syn keyword openscadTransform scale rotate translate resize mirror multmatrix color minkowski hull projection linear_extrude rotate_extrude offset
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 syn keyword openscadPrimitiveSolid cube sphere cylinder polyhedron surface
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 syn keyword openscadPrimitive2D square circle polygon import_dxf text
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 syn keyword openscadPrimitiveImport import child children
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 syn match openscadNumbers "\<\d\|\.\d" contains=openscadNumber display transparent
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 syn match openscadNumber "\d\+" display contained
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 syn match openscadNumber "\.\d\+" display contained
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 syn region openscadString start=/"/ skip=/\\"/ end=/"/
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 syn keyword openscadBoolean true false
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 syn keyword openscadCommentTodo TODO FIXME XXX NOTE contained display
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 syn match openscadInlineComment ://.*$: contains=openscadCommentTodo
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 syn region openscadBlockComment start=:/\*: end=:\*/: fold contains=openscadCommentTodo
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 syn region openscadBlock start="{" end="}" transparent fold
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 syn region openscadVector start="\[" end="\]" transparent fold
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 syn keyword openscadBuiltin abs acos asin atan atan2 ceil cos exp floor ln log
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 syn keyword openscadBuiltin lookup max min pow rands round sign sin sqrt tan
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 syn keyword openscadBuiltin str len search version version_num concat chr ord cross norm
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 syn keyword openscadBuiltin parent_module
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 syn keyword openscadBuiltin dxf_cross dxf_dim
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 syn keyword openscadBuiltinSpecial PI undef
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 """""""""""""""""""""""""""""""""""""""""
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 " linkage
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 """""""""""""""""""""""""""""""""""""""""
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 hi def link openscadFunctionDef Structure
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 hi def link openscadAoperator Function
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 hi def link openscadLi Function
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 " hi def link openscadPar Structure
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 hi def link openscadBuiltinSpecial Special
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 hi def link openscadBinaryoperator Special
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 hi def link openscadFunction Function
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 hi def link openscadModuleDef Structure
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 hi def link openscadModule Function
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 hi def link openscadBlockComment Comment
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 hi def link openscadBoolean Boolean
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 hi def link openscadBuiltin Function
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 hi def link openscadConditional Conditional
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 hi def link openscadCsgKeyword Structure
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 hi def link openscadInclude Include
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 hi def link openscadInlineComment Comment
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 hi def link openscadModifier Special
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 hi def link openscadStatement Statement
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 hi def link openscadNumbers Number
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 hi def link openscadNumber Number
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 hi def link openscadPrimitiveSolid Keyword
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 hi def link openscadPrimitive2D Keyword
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 hi def link openscadPrimitiveImport Keyword
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 hi def link openscadRepeat Repeat
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 hi def link openscadSpecialVariable Special
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 hi def link openscadString String
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 hi def link openscadTransform Statement
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 hi def link openscadCommentTodo Todo
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 let b:current_syntax = 'openscad'