Mercurial > vim
annotate runtime/syntax/j.vim @ 5734:657ade71d395
Updated runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 22 Mar 2014 21:02:50 +0100 |
parents | 9521463d4fc1 |
children | d735e62f5925 |
rev | line source |
---|---|
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
1 " Vim syntax file |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
2 " Language: J |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
3 " Maintainer: David Bürgin <676c7473@gmail.com> |
5734 | 4 " URL: https://github.com/glts/vim-j |
5 " Last Change: 2014-03-17 | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
6 |
5734 | 7 if exists('b:current_syntax') |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
8 finish |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
9 endif |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
10 |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
11 syntax case match |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
12 syntax sync minlines=50 |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
13 |
5734 | 14 syntax match jControl /\<\%(assert\|break\|case\|catch[dt]\=\|continue\|do\|else\%(if\)\=\|end\|fcase\|for\|if\|return\|select\|throw\|try\|whil\%(e\|st\)\)\./ |
15 syntax match jControl /\<\%(for\|goto\|label\)_\a\k*\./ | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
16 |
5734 | 17 " Standard library names defined in the z locale. A few verbs need to be |
18 " defined with ":syntax match" because they would otherwise take precedence | |
19 " over the corresponding jControl items. | |
20 syntax keyword jNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB adverb andurl conjunction dbhelp dyad libjqt monad noun verb | |
21 syntax keyword jAdverb define each every fapplylines inv inverse items leaf rows table | |
22 syntax keyword jConjunction bind cuts def on | |
23 syntax keyword jVerb AND Endian IFDEF Note OR XOR alpha17 alpha27 anddf android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpathsep jsystemdefs list ljust load loadd mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc script scriptd setbreak show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep | |
24 syntax match jVerb /\<\%(assert\|break\|do\)\>\.\@!/ | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
25 |
5734 | 26 syntax region jString oneline start=/'/ skip=/''/ end=/'/ |
27 | |
28 " Number patterns. Matching J numbers is difficult. The regular expression | |
29 " used for the general case roughly embodies this grammar sketch: | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
30 " |
5734 | 31 " BASE := /_?\d+(\.\d*)?([eE]_?\d+)?/ |
32 " RATIONAL := BASE | BASE r BASE | |
33 " COMPLEX := BASE | BASE (j|a[dr]) BASE | |
34 " JNUMBER := RATIONAL | RATIONAL [px] RATIONAL | COMPLEX | COMPLEX [px] COMPLEX | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
35 " |
5734 | 36 " The grammar is implemented as shown in this pseudo-regexp: |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
37 " |
5734 | 38 " base rational complex remainder |
39 " /\< B ( [r]B ([px]B([r]B)?)? | (j|a[dr])B ([px]B((j|a[dr])B)?)? | [px]B ((j|a[dr]|r)B)? )?/ | |
40 " | |
41 " All in all, a compromise between correctness and practicality had to be | |
42 " made. See http://www.jsoftware.com/help/dictionary/dcons.htm for reference. | |
43 syntax match jNumber /\<_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\|r\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\)\=/ | |
44 syntax match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+/ | |
45 syntax match jNumber /\<__\=\>/ | |
46 syntax match jNumber /\<_\=\d\+x\>/ | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
47 |
5734 | 48 syntax keyword jTodo TODO FIXME XXX contained |
49 syntax match jComment /NB\..*$/ contains=jTodo,@Spell | |
50 syntax match jSharpBang /\%^#!.*$/ | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
51 |
5734 | 52 highlight default link jControl Statement |
53 highlight default link jNoun Identifier | |
54 highlight default link jAdverb Identifier | |
55 highlight default link jConjunction Identifier | |
56 highlight default link jVerb Function | |
57 highlight default link jString String | |
58 highlight default link jNumber Number | |
59 highlight default link jTodo Todo | |
60 highlight default link jComment Comment | |
61 highlight default link jSharpBang PreProc | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
62 |
5734 | 63 let b:current_syntax = 'j' |