framescript.vim 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. " Vim syntax file
  2. " Language: FrameScript v4.0
  3. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision: 2007-02-22
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. let s:cpo_save = &cpo
  9. set cpo&vim
  10. syn match framescriptOperator
  11. \ '[+*/%=-]\|[><]=\=\|#[&|]'
  12. syn keyword framescriptTodo
  13. \ contained
  14. \ TODO FIXME XXX NOTE
  15. syn cluster framescriptCommentGroup
  16. \ contains=
  17. \ framescriptTodo,
  18. \ @Spell
  19. syn match framescriptComment
  20. \ display
  21. \ contains=@framescriptCommentGroup
  22. \ '//.*$'
  23. syn region framescriptComment
  24. \ contains=@framescriptCommentGroup
  25. \ matchgroup=framescriptCommentStart
  26. \ start='/\*'
  27. \ end='\*/'
  28. syn case ignore
  29. syn match framescriptInclude
  30. \ display
  31. \ contains=framescriptIncluded
  32. \ "^\s*<#Include\>\s*'"
  33. syn region framescriptIncluded
  34. \ contained
  35. \ display
  36. \ start=+'+
  37. \ skip=+\\\\\|\\'+
  38. \ end=+'+
  39. syn match framescriptNumbers
  40. \ display
  41. \ transparent
  42. \ contains=
  43. \ framescriptInteger,
  44. \ framescriptReal,
  45. \ framescriptMetric,
  46. \ framescriptCharacter
  47. \ '\<\d\|\.\d'
  48. syn keyword framescriptBoolean
  49. \ True False
  50. syn match framescriptInteger
  51. \ contained
  52. \ display
  53. \ '\d\+\>'
  54. syn match framescriptInteger
  55. \ contained
  56. \ display
  57. \ '\x\+H\>'
  58. syn match framescriptInteger
  59. \ contained
  60. \ display
  61. \ '[01]\+B\>'
  62. syn match framescriptReal
  63. \ contained
  64. \ display
  65. \ '\d\+\.\d*\|\.\d\+\>'
  66. syn match framescriptMetric
  67. \ contained
  68. \ display
  69. \ '\%(\d\+\%(\.\d*\)\=\|\.\d\+\)\%(pts\|in\|"\|cm\|mm\|pica\)\>'
  70. syn match framescriptCharacter
  71. \ contained
  72. \ display
  73. \ '\d\+S\>'
  74. syn region framescriptString
  75. \ contains=framescriptStringSpecialChar,@Spell
  76. \ start=+'+
  77. \ skip=+\\\\\|\\'+
  78. \ end=+'+
  79. syn match framescriptStringSpecialChar
  80. \ contained
  81. \ display
  82. \ "\\[\\']"
  83. syn keyword framescriptConstant
  84. \ BackSlash
  85. \ CharCR
  86. \ CharLF
  87. \ CharTAB
  88. \ ClientDir
  89. \ ClientName
  90. \ FslVersionMajor
  91. \ FslVersionMinor
  92. \ InstallName
  93. \ InstalledScriptList
  94. \ MainScript
  95. \ NULL
  96. \ ObjEndOffset
  97. \ ProductRevision
  98. \ Quote
  99. \ ThisScript
  100. syn keyword framescriptOperator
  101. \ not
  102. \ and
  103. \ or
  104. syn keyword framescriptSessionVariables
  105. \ ErrorCode
  106. \ ErrorMsg
  107. \ DeclareVarMode
  108. \ PlatformEncodingMode
  109. syn keyword framescriptStructure
  110. \ Event
  111. \ EndEvent
  112. syn keyword framescriptStatement
  113. \ Sub
  114. \ EndSub
  115. \ Run
  116. \ Function
  117. \ EndFunction
  118. \ Set
  119. \ Add
  120. \ Apply
  121. \ CallClient
  122. \ Close
  123. \ Copy
  124. \ Cut
  125. \ DialogBox
  126. \ Delete
  127. \ Demote
  128. \ Display
  129. \ DocCompare
  130. \ Export
  131. \ Find
  132. \ LeaveLoop
  133. \ LeaveScript
  134. \ LeaveSub
  135. \ LoopNext
  136. \ Merge
  137. \ MsgBox
  138. \ Paste
  139. \ PopClipboard
  140. \ PushClipboard
  141. \ Read
  142. \ Replace
  143. \ Return
  144. \ Sort
  145. \ Split
  146. syn keyword framescriptStatement
  147. \ nextgroup=framescriptApplySubStatement skipwhite skipempty
  148. \ Apply
  149. syn keyword framescriptApplySubStatement
  150. \ contained
  151. \ Pagelayout
  152. \ TextProperties
  153. syn keyword framescriptStatement
  154. \ nextgroup=framescriptClearSubStatement skipwhite skipempty
  155. \ Clear
  156. syn keyword framescriptClearSubStatement
  157. \ contained
  158. \ ChangeBars
  159. \ Text
  160. syn keyword framescriptStatement
  161. \ nextgroup=framescriptCloseSubStatement skipwhite skipempty
  162. \ Close
  163. syn keyword framescriptCloseSubStatement
  164. \ contained
  165. \ Book
  166. \ Document
  167. \ TextFile
  168. syn keyword framescriptStatement
  169. \ nextgroup=framescriptExecSubStatement skipwhite skipempty
  170. \ Exec
  171. syn keyword framescriptExecSubStatement
  172. \ contained
  173. \ Compile
  174. \ Script
  175. \ Wait
  176. syn keyword framescriptStatement
  177. \ nextgroup=framescriptExecuteSubStatement skipwhite skipempty
  178. \ Execute
  179. syn keyword framescriptExecuteSubStatement
  180. \ contained
  181. \ FrameCommand
  182. \ Hypertext
  183. \ StartUndoCheckPoint
  184. \ EndUndoCheckPoint
  185. \ ClearUndoHistory
  186. syn keyword framescriptStatement
  187. \ nextgroup=framescriptGenerateSubStatement skipwhite skipempty
  188. \ Generate
  189. syn keyword framescriptGenerateSubStatement
  190. \ contained
  191. \ Bookfile
  192. syn keyword framescriptStatement
  193. \ nextgroup=framescriptGetSubStatement skipwhite skipempty
  194. \ Get
  195. syn keyword framescriptGetSubStatement
  196. \ contained
  197. \ Member
  198. \ Object
  199. \ String
  200. \ TextList
  201. \ TextProperties
  202. syn keyword framescriptStatement
  203. \ nextgroup=framescriptImportSubStatement skipwhite skipempty
  204. \ Import
  205. syn keyword framescriptImportSubStatement
  206. \ contained
  207. \ File
  208. \ Formats
  209. \ ElementDefs
  210. syn keyword framescriptStatement
  211. \ nextgroup=framescriptInstallSubStatement skipwhite skipempty
  212. \ Install
  213. \ Uninstall
  214. syn keyword framescriptInstallSubStatement
  215. \ contained
  216. \ ChangeBars
  217. \ Text
  218. syn keyword framescriptStatement
  219. \ nextgroup=framescriptNewSubStatement skipwhite skipempty
  220. \ New
  221. syn keyword framescriptNewSubStatement
  222. \ contained
  223. \ AFrame
  224. \ Footnote
  225. \ Marker
  226. \ TiApiClient
  227. \ Variable
  228. \ XRef
  229. \ FormatChangeList
  230. \ FormatRule
  231. \ FmtRuleClause
  232. \ Arc
  233. \ Ellipse
  234. \ Flow
  235. \ Group
  236. \ Inset
  237. \ Line
  238. \ Math
  239. \ Polygon
  240. \ Polyline
  241. \ Rectangle
  242. \ RoundRect
  243. \ TextFrame
  244. \ Textline
  245. \ UnanchoredFrame
  246. \ Command
  247. \ Menu
  248. \ MenuItemSeparator
  249. \ Book
  250. \ CharacterFormat
  251. \ Color
  252. \ ConditionFormat
  253. \ ElementDef
  254. \ FormatChangeList
  255. \ MarkerType
  256. \ MasterPage
  257. \ ParagraphFormat
  258. \ PgfFmt
  259. \ ReferencePAge
  260. \ RulingFormat
  261. \ TableFormat
  262. \ VariableFormat
  263. \ XRefFormat
  264. \ BodyPage
  265. \ BookComponent
  266. \ Paragraph
  267. \ Element
  268. \ Attribute
  269. \ AttributeDef
  270. \ AttributeList
  271. \ AttributeDefList
  272. \ ElementLoc
  273. \ ElementRange
  274. \ Table
  275. \ TableRows
  276. \ TableCols
  277. \ Text
  278. \ Integer
  279. \ Real
  280. \ Metric
  281. \ String
  282. \ Object
  283. \ TextLoc
  284. \ TextRange
  285. \ IntList
  286. \ UIntList
  287. \ MetricList
  288. \ StringList
  289. \ PointList
  290. \ TabList
  291. \ PropertyList
  292. \ LibVar
  293. \ ScriptVar
  294. \ SubVar
  295. \ TextFile
  296. syn keyword framescriptStatement
  297. \ nextgroup=framescriptOpenSubStatement skipwhite skipempty
  298. \ Open
  299. syn keyword framescriptOpenSubStatement
  300. \ contained
  301. \ Document
  302. \ Book
  303. \ TextFile
  304. syn keyword framescriptStatement
  305. \ nextgroup=framescriptPrintSubStatement skipwhite skipempty
  306. \ Print
  307. syn keyword framescriptPrintSubStatement
  308. \ contained
  309. \ Document
  310. \ Book
  311. syn keyword framescriptStatement
  312. \ nextgroup=framescriptQuitSubStatement skipwhite skipempty
  313. \ Quit
  314. syn keyword framescriptQuitSubStatement
  315. \ contained
  316. \ Session
  317. syn keyword framescriptStatement
  318. \ nextgroup=framescriptRemoveSubStatement skipwhite skipempty
  319. \ Remove
  320. syn keyword framescriptRemoveSubStatement
  321. \ contained
  322. \ Attribute
  323. \ CommandObject
  324. syn keyword framescriptStatement
  325. \ nextgroup=framescriptSaveSubStatement skipwhite skipempty
  326. \ Save
  327. syn keyword framescriptSaveSubStatement
  328. \ contained
  329. \ Document
  330. \ Book
  331. syn keyword framescriptStatement
  332. \ nextgroup=framescriptSelectSubStatement skipwhite skipempty
  333. \ Select
  334. syn keyword framescriptSelectSubStatement
  335. \ contained
  336. \ TableCells
  337. syn keyword framescriptStatement
  338. \ nextgroup=framescriptStraddleSubStatement skipwhite skipempty
  339. \ Straddle
  340. syn keyword framescriptStraddleSubStatement
  341. \ contained
  342. \ TableCells
  343. syn keyword framescriptStatement
  344. \ nextgroup=framescriptUpdateSubStatement skipwhite skipempty
  345. \ Update
  346. syn keyword framescriptUpdateSubStatement
  347. \ contained
  348. \ ReDisplay
  349. \ Formatting
  350. \ Hyphenating
  351. \ ResetEquationsSettings
  352. \ ResetRefFrames
  353. \ RestartPgfNums
  354. \ TextInset
  355. \ Variables
  356. \ XRefs
  357. \ Book
  358. syn keyword framescriptStatement
  359. \ nextgroup=framescriptWriteSubStatement skipwhite skipempty
  360. \ Write
  361. syn keyword framescriptUpdateSubStatement
  362. \ contained
  363. \ Console
  364. \ Display
  365. syn keyword framescriptRepeat
  366. \ Loop
  367. \ EndLoop
  368. syn keyword framescriptConditional
  369. \ If
  370. \ ElseIf
  371. \ Else
  372. \ EndIf
  373. syn keyword framescriptType
  374. \ Local
  375. \ GlobalVar
  376. let b:framescript_minlines = exists("framescript_minlines")
  377. \ ? framescript_minlines : 15
  378. exec "syn sync ccomment framescriptComment minlines=" . b:framescript_minlines
  379. hi def link framescriptTodo Todo
  380. hi def link framescriptComment Comment
  381. hi def link framescriptCommentStart framescriptComment
  382. hi def link framescriptInclude Include
  383. hi def link framescriptIncluded String
  384. hi def link framescriptBoolean Boolean
  385. hi def link framescriptNumber Number
  386. hi def link framescriptInteger framescriptNumber
  387. hi def link framescriptReal framescriptNumber
  388. hi def link framescriptMetric framescriptNumber
  389. hi def link framescriptCharacter framescriptNumber
  390. hi def link framescriptString String
  391. hi def link framescriptStringSpecialChar SpecialChar
  392. hi def link framescriptConstant Constant
  393. hi def link framescriptOperator None
  394. hi def link framescriptSessionVariables PreProc
  395. hi def link framescriptStructure Structure
  396. hi def link framescriptStatement Statement
  397. hi def link framescriptSubStatement Type
  398. hi def link framescriptApplySubStatement framescriptSubStatement
  399. hi def link framescriptClearSubStatement framescriptSubStatement
  400. hi def link framescriptCloseSubStatement framescriptSubStatement
  401. hi def link framescriptExecSubStatement framescriptSubStatement
  402. hi def link framescriptExecuteSubStatement framescriptSubStatement
  403. hi def link framescriptGenerateSubStatement framescriptSubStatement
  404. hi def link framescriptGetSubStatement framescriptSubStatement
  405. hi def link framescriptImportSubStatement framescriptSubStatement
  406. hi def link framescriptInstallSubStatement framescriptSubStatement
  407. hi def link framescriptNewSubStatement framescriptSubStatement
  408. hi def link framescriptOpenSubStatement framescriptSubStatement
  409. hi def link framescriptPrintSubStatement framescriptSubStatement
  410. hi def link framescriptQuitSubStatement framescriptSubStatement
  411. hi def link framescriptRemoveSubStatement framescriptSubStatement
  412. hi def link framescriptSaveSubStatement framescriptSubStatement
  413. hi def link framescriptSelectSubStatement framescriptSubStatement
  414. hi def link framescriptStraddleSubStatement framescriptSubStatement
  415. hi def link framescriptUpdateSubStatement framescriptSubStatement
  416. hi def link framescriptRepeat Repeat
  417. hi def link framescriptConditional Conditional
  418. hi def link framescriptType Type
  419. let b:current_syntax = "framescript"
  420. let &cpo = s:cpo_save
  421. unlet s:cpo_save