Skip to content

Commit 63ec85b

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 2561504 + 2faa29f commit 63ec85b

35 files changed

Lines changed: 1527 additions & 624 deletions

Filelist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ SRC_ALL = \
4040
src/hardcopy.c \
4141
src/hashtab.c \
4242
src/keymap.h \
43+
src/json.c \
4344
src/macros.h \
4445
src/main.c \
4546
src/mark.c \
@@ -132,6 +133,7 @@ SRC_ALL = \
132133
src/proto/gui_beval.pro \
133134
src/proto/hardcopy.pro \
134135
src/proto/hashtab.pro \
136+
src/proto/json.pro \
135137
src/proto/main.pro \
136138
src/proto/mark.pro \
137139
src/proto/mbyte.pro \

runtime/doc/eval.txt

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 21
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 23
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1409,6 +1409,10 @@ v:exception The value of the exception most recently caught and not
14091409
:endtry
14101410
< Output: "caught oops".
14111411

1412+
*v:false* *false-variable*
1413+
v:false A Number with value zero. Used to put "false" in JSON. See
1414+
|jsonencode()|.
1415+
14121416
*v:fcs_reason* *fcs_reason-variable*
14131417
v:fcs_reason The reason why the |FileChangedShell| event was triggered.
14141418
Can be used in an autocommand to decide what to do and/or what
@@ -1542,6 +1546,14 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|.
15421546
This is the screen column number, like with |virtcol()|. The
15431547
value is zero when there was no mouse button click.
15441548

1549+
*v:none* *none-variable*
1550+
v:none An empty String. Used to put an empty item in JSON. See
1551+
|jsonencode()|.
1552+
1553+
*v:null* *null-variable*
1554+
v:null An empty String. Used to put "null" in JSON. See
1555+
|jsonencode()|.
1556+
15451557
*v:oldfiles* *oldfiles-variable*
15461558
v:oldfiles List of file names that is loaded from the |viminfo| file on
15471559
startup. These are the files that Vim remembers marks for.
@@ -1707,6 +1719,10 @@ v:throwpoint The point where the exception most recently caught and not
17071719
:endtry
17081720
< Output: "Exception from test.vim, line 2"
17091721

1722+
*v:true* *true-variable*
1723+
v:true A Number with value one. Used to put "true" in JSON. See
1724+
|jsonencode()|.
1725+
17101726
*v:val* *val-variable*
17111727
v:val Value of the current item of a |List| or |Dictionary|. Only
17121728
valid while evaluating the expression used with |map()| and
@@ -1913,6 +1929,8 @@ isdirectory( {directory}) Number TRUE if {directory} is a directory
19131929
islocked( {expr}) Number TRUE if {expr} is locked
19141930
items( {dict}) List key-value pairs in {dict}
19151931
join( {list} [, {sep}]) String join {list} items into one String
1932+
jsondecode( {string}) any decode JSON
1933+
jsonencode( {expr}) String encode JSON
19161934
keys( {dict}) List keys in {dict}
19171935
len( {expr}) Number the length of {expr}
19181936
libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
@@ -4215,6 +4233,27 @@ join({list} [, {sep}]) *join()*
42154233
converted into a string like with |string()|.
42164234
The opposite function is |split()|.
42174235

4236+
jsondecode({string}) *jsondecode()*
4237+
TODO
4238+
4239+
jsonencode({expr}) *jsonencode()*
4240+
Encodode {expr} as JSON and return this as a string.
4241+
The encoding is specified in:
4242+
http://www.ietf.org/rfc/rfc4627.txt
4243+
Vim values are converted as follows:
4244+
Number decimal number
4245+
Float floating point number
4246+
String in double quotes (possibly null)
4247+
Funcref nothing
4248+
List as an array (possibly null); when
4249+
used recursively: []
4250+
Dict as an object (possibly null); when
4251+
used recursively: {}
4252+
v:false "false"
4253+
v:true "true"
4254+
v:none nothing
4255+
v:null "null"
4256+
42184257
keys({dict}) *keys()*
42194258
Return a |List| with all the keys of {dict}. The |List| is in
42204259
arbitrary order.

src/Make_bc3.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ EXE_dependencies = \
7272
getchar.obj \
7373
hardcopy.obj \
7474
hashtab.obj \
75+
json.obj \
7576
main.obj \
7677
mark.obj \
7778
memfile.obj \

src/Make_bc5.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ vimobj = \
598598
$(OBJDIR)\getchar.obj \
599599
$(OBJDIR)\hardcopy.obj \
600600
$(OBJDIR)\hashtab.obj \
601+
$(OBJDIR)\json.obj \
601602
$(OBJDIR)\main.obj \
602603
$(OBJDIR)\mark.obj \
603604
$(OBJDIR)\memfile.obj \

src/Make_cyg_ming.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ OBJ = \
601601
$(OUTDIR)/getchar.o \
602602
$(OUTDIR)/hardcopy.o \
603603
$(OUTDIR)/hashtab.o \
604+
$(OUTDIR)/json.o \
604605
$(OUTDIR)/main.o \
605606
$(OUTDIR)/mark.o \
606607
$(OUTDIR)/memfile.o \

src/Make_dice.mak

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ SRC = \
4545
getchar.c \
4646
hardcopy.c \
4747
hashtab.c \
48+
json.c \
4849
main.c \
4950
mark.c \
5051
memfile.c \
@@ -93,6 +94,7 @@ OBJ = o/blowfish.o \
9394
o/getchar.o \
9495
o/hardcopy.o \
9596
o/hashtab.o \
97+
o/json.o \
9698
o/main.o \
9799
o/mark.o \
98100
o/memfile.o \
@@ -179,6 +181,8 @@ o/hardcopy.o: hardcopy.c $(SYMS)
179181

180182
o/hashtab.o: hashtab.c $(SYMS)
181183

184+
o/json.o: json.c $(SYMS)
185+
182186
o/main.o: main.c $(SYMS)
183187

184188
o/mark.o: mark.c $(SYMS)

src/Make_ivc.mak

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ LINK32_OBJS= \
229229
"$(INTDIR)/getchar.obj" \
230230
"$(INTDIR)/hardcopy.obj" \
231231
"$(INTDIR)/hashtab.obj" \
232+
"$(INTDIR)/json.obj" \
232233
"$(INTDIR)/main.obj" \
233234
"$(INTDIR)/mark.obj" \
234235
"$(INTDIR)/mbyte.obj" \
@@ -555,6 +556,10 @@ SOURCE=.\if_ole.idl
555556
# End Source File
556557
# Begin Source File
557558

559+
SOURCE=.\json.c
560+
# End Source File
561+
# Begin Source File
562+
558563
SOURCE=.\main.c
559564
# End Source File
560565
# Begin Source File

src/Make_manx.mak

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ SRC = blowfish.c \
5555
getchar.c \
5656
hardcopy.c \
5757
hashtab.c \
58+
json.c \
5859
main.c \
5960
mark.c \
6061
memfile.c \
@@ -105,6 +106,7 @@ OBJ = obj/blowfish.o \
105106
obj/getchar.o \
106107
obj/hardcopy.o \
107108
obj/hashtab.o \
109+
obj/json.o \
108110
obj/main.o \
109111
obj/mark.o \
110112
obj/memfile.o \
@@ -153,6 +155,7 @@ PRO = proto/blowfish.pro \
153155
proto/getchar.pro \
154156
proto/hardcopy.pro \
155157
proto/hashtab.pro \
158+
proto/json.pro \
156159
proto/main.pro \
157160
proto/mark.pro \
158161
proto/memfile.pro \
@@ -284,6 +287,9 @@ obj/hardcopy.o: hardcopy.c
284287
obj/hashtab.o: hashtab.c
285288
$(CCSYM) $@ hashtab.c
286289

290+
obj/json.o: json.c
291+
$(CCSYM) $@ json.c
292+
287293
# Don't use $(SYMS) here, because main.c defines EXTERN
288294
obj/main.o: main.c option.h globals.h
289295
$(CCNOSYM) $@ main.c

src/Make_morph.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ SRC = blowfish.c \
4343
getchar.c \
4444
hardcopy.c \
4545
hashtab.c \
46+
json.c \
4647
main.c \
4748
mark.c \
4849
mbyte.c \

src/Make_mvc.mak

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ OBJ = \
536536
$(OUTDIR)\getchar.obj \
537537
$(OUTDIR)\hardcopy.obj \
538538
$(OUTDIR)\hashtab.obj \
539+
$(OUTDIR)\json.obj \
539540
$(OUTDIR)\main.obj \
540541
$(OUTDIR)\mark.obj \
541542
$(OUTDIR)\mbyte.obj \
@@ -1202,6 +1203,8 @@ $(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
12021203
$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
12031204
$(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
12041205

1206+
$(OUTDIR)/json.obj: $(OUTDIR) json.c $(INCL)
1207+
12051208
$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
12061209

12071210
$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
@@ -1329,6 +1332,7 @@ proto.h: \
13291332
proto/getchar.pro \
13301333
proto/hardcopy.pro \
13311334
proto/hashtab.pro \
1335+
proto/json.pro \
13321336
proto/main.pro \
13331337
proto/mark.pro \
13341338
proto/memfile.pro \

0 commit comments

Comments
 (0)