annotate runtime/syntax/snnspat.vim @ 4287:dc3efb6d5a08 v7.3.893

updated for version 7.3.893 Problem: Crash when using b:, w: or t: after closing the buffer, window or tabpage. Solution: Allocate the dictionary instead of having it part of the buffer/window/tabpage struct. (Yukihiro Nakadaira)
author Bram Moolenaar <bram@vim.org>
date Mon, 15 Apr 2013 12:27:36 +0200
parents b7811ab264bf
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: SNNS pattern file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Davide Alberani <alberanid@bigfoot.com>
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Last Change: 2012 Feb 03 by Thilo Six
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Version: 0.2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " URL: http://digilander.iol.it/alberanid/vim/syntax/snnspat.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " is a simulator for neural networks.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
17 let s:cpo_save = &cpo
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
18 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " anything that isn't part of the header, a comment or a number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " is wrong
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match snnspatError ".*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " hoping that matches any kind of notation...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match snnspatAccepted "\([-+]\=\(\d\+\.\|\.\)\=\d\+\([Ee][-+]\=\d\+\)\=\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match snnspatAccepted "\s"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match snnspatBrac "\[\s*\d\+\(\s\|\d\)*\]" contains=snnspatNumbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " the accepted fields in the header
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match snnspatNoHeader "No\. of patterns\s*:\s*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match snnspatNoHeader "No\. of input units\s*:\s*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match snnspatNoHeader "No\. of output units\s*:\s*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match snnspatNoHeader "No\. of variable input dimensions\s*:\s*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match snnspatNoHeader "No\. of variable output dimensions\s*:\s*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match snnspatNoHeader "Maximum input dimensions\s*:\s*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match snnspatNoHeader "Maximum output dimensions\s*:\s*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match snnspatGen "generated at.*" contained contains=snnspatNumbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match snnspatGen "SNNS pattern definition file [Vv]\d\.\d" contained contains=snnspatNumbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " the header, what is not an accepted field, is an error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn region snnspatHeader start="^SNNS" end="^\s*[-+\.]\=[0-9#]"me=e-2 contains=snnspatNoHeader,snnspatNumbers,snnspatGen,snnspatBrac
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " numbers inside the header
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match snnspatNumbers "\d" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match snnspatComment "#.*$" contains=snnspatTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword snnspatTodo TODO XXX FIXME contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 if version >= 508 || !exists("did_snnspat_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 let did_snnspat_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 HiLink snnspatGen Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 HiLink snnspatHeader Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 HiLink snnspatNoHeader Define
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 HiLink snnspatNumbers Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 HiLink snnspatComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 HiLink snnspatError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 HiLink snnspatTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 HiLink snnspatAccepted NONE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 HiLink snnspatBrac NONE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 let b:current_syntax = "snnspat"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
70 let &cpo = s:cpo_save
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
71 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " vim: ts=8 sw=2