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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
4 " URL: https://github.com/glts/vim-j
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
14 syntax match jControl /\<\%(assert\|break\|case\|catch[dt]\=\|continue\|do\|else\%(if\)\=\|end\|fcase\|for\|if\|return\|select\|throw\|try\|whil\%(e\|st\)\)\./
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
17 " Standard library names defined in the z locale. A few verbs need to be
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
18 " defined with ":syntax match" because they would otherwise take precedence
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
19 " over the corresponding jControl items.
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
21 syntax keyword jAdverb define each every fapplylines inv inverse items leaf rows table
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
22 syntax keyword jConjunction bind cuts def on
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
26 syntax region jString oneline start=/'/ skip=/''/ end=/'/
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
27
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
28 " Number patterns. Matching J numbers is difficult. The regular expression
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
31 " BASE := /_?\d+(\.\d*)?([eE]_?\d+)?/
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
32 " RATIONAL := BASE | BASE r BASE
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
33 " COMPLEX := BASE | BASE (j|a[dr]) BASE
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
38 " base rational complex remainder
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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)? )?/
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
40 "
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
41 " All in all, a compromise between correctness and practicality had to be
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
42 " made. See http://www.jsoftware.com/help/dictionary/dcons.htm for reference.
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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\+\)\=\)\=\)\)\=/
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
44 syntax match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+/
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
45 syntax match jNumber /\<__\=\>/
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
48 syntax keyword jTodo TODO FIXME XXX contained
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
49 syntax match jComment /NB\..*$/ contains=jTodo,@Spell
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
50 syntax match jSharpBang /\%^#!.*$/
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51
5734
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
52 highlight default link jControl Statement
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
53 highlight default link jNoun Identifier
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
54 highlight default link jAdverb Identifier
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
55 highlight default link jConjunction Identifier
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
56 highlight default link jVerb Function
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
57 highlight default link jString String
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
58 highlight default link jNumber Number
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
59 highlight default link jTodo Todo
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
60 highlight default link jComment Comment
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
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
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5425
diff changeset
63 let b:current_syntax = 'j'