diff options
author | Martin Nordholts <enselic@gmail.com> | 2021-10-23 11:27:59 +0200 |
---|---|---|
committer | Martin Nordholts <enselic@gmail.com> | 2021-10-23 13:35:32 +0200 |
commit | 6eb2cc9caccbf45bb1d3b4f404ff4ee825ec4dcf (patch) | |
tree | bffae0fa13c6ac199f9346d50c7bb4c31fe6ce93 /tests/syntax-tests | |
parent | f28d9db3d0903dfa6ecbaf9fae6e3e4605c6f33d (diff) |
Add LiveScript syntax
The file `LiveScript.sublime-syntax` is a pure export from a licenced version
of Sublime Text, Version 3.1.1, Build 3176 with
assets/syntaxes/02_Extra/LiveScript/Syntaxes/LiveScript.tmLanguage as the source
file.
Diffstat (limited to 'tests/syntax-tests')
3 files changed, 189 insertions, 0 deletions
diff --git a/tests/syntax-tests/highlighted/LiveScript/livescript-demo.ls b/tests/syntax-tests/highlighted/LiveScript/livescript-demo.ls new file mode 100644 index 00000000..f6aba10c --- /dev/null +++ b/tests/syntax-tests/highlighted/LiveScript/livescript-demo.ls @@ -0,0 +1,83 @@ +[38;2;166;226;46ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m->[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m +[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;166;226;46mb[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m-->[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m +[38;2;249;38;114mvar[0m[38;2;248;248;242m [0m[38;2;166;226;46mc[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m~>[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m +[38;2;166;226;46md[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m~~>[0m +[38;2;166;226;46me[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255ma[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m->[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255mb[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m~>[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255mc[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m-->[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255md[0m[38;2;248;248;242m, [0m[38;2;102;217;239me[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m~~>[0m[38;2;248;248;242m [0m[38;2;190;132;255m5[0m +[38;2;166;226;46mdashes-identifier[0m[38;2;166;226;46ms[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m->[0m +[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m +[38;2;248;248;242m [0m[38;2;255;255;255mb[0m[38;2;248;248;242m [0m[38;2;249;38;114m--[0m[38;2;248;248;242m [0m[38;2;255;255;255mc[0m +[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m-[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m +[38;2;248;248;242m [0m[38;2;255;255;255ma-[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m +[38;2;248;248;242m [0m[38;2;248;248;242ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;255;255;255ma[0m + +[38;2;246;170;17m//abc [0m[38;2;246;170;17m#[0m[38;2;246;170;17meaze [0m[38;2;246;170;17m#[0m[38;2;246;170;17m@ //[0m +[38;2;246;170;17m//[0m +[38;2;246;170;17ma [0m[38;2;246;170;17m#[0m[38;2;246;170;17mbaze[0m +[38;2;246;170;17m//[0m + +[38;2;255;255;255mpubli[0m +[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;102;217;239mit[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;230;219;116m\[0m[38;2;230;219;116mabc[0m[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;166;226;46m$-[0m[38;2;166;226;46my[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m![0m[38;2;255;255;255m([0m[38;2;255;255;255ma[0m[38;2;248;248;242m,[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m->[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m~[0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mmap[0m[38;2;248;248;242m [0m[38;2;246;170;17m//a[0m[38;2;246;170;17m#[0m[38;2;246;170;17m//[0m +[38;2;249;38;114mthen[0m[38;2;248;248;242m [0m[38;2;249;38;114mmatch[0m[38;2;248;248;242m [0m[38;2;102;217;239mthat[0m[38;2;248;248;242m [0m[38;2;249;38;114m| _[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;249;38;114motherwise[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;249;38;114mimplements[0m[38;2;248;248;242m [0m[38;2;248;248;242m$[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116m#[0m[38;2;230;219;116mabc [0m[38;2;230;219;116m#[0m[38;2;230;219;116m@a[0m[38;2;230;219;116m"[0m[38;2;255;255;255m)[0m + +[38;2;249;38;114mswitch[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;255;255;255ma[0m[38;2;249;38;114m=>[0m[38;2;255;255;255mb[0m +[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m [0m[38;2;255;255;255mb[0m + +[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;255;255;255mb[0m[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;255;255;255mc[0m + +[38;2;166;226;46munderscores_i$[0m[38;2;166;226;46md[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m->[0m +[38;2;246;170;17m/regexp1/[0m[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;246;170;17m//regexp2//g[0m +[38;2;230;219;116m'[0m[38;2;230;219;116mstrings[0m[38;2;230;219;116m'[0m[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mstrings[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;230;219;116m\[0m[38;2;230;219;116mstrings[0m +[38;2;255;255;255m([0m[38;2;248;248;242m[[0m[38;2;190;132;255m2[0m[38;2;248;248;242m [0m[38;2;249;38;114mtil[0m[38;2;248;248;242m [0m[38;2;190;132;255m10[0m[38;2;248;248;242m] [0m[38;2;249;38;114mor[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114mto[0m[38;2;248;248;242m [0m[38;2;190;132;255m50[0m[38;2;248;248;242m][0m[38;2;255;255;255m)[0m +[38;2;248;248;242m [0m[38;2;249;38;114m|>[0m[38;2;248;248;242m [0m[38;2;248;248;242mmap[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m([0m[38;2;249;38;114m*[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;255;255;255m)[0m +[38;2;248;248;242m [0m[38;2;249;38;114m|>[0m[38;2;248;248;242m [0m[38;2;248;248;242mfilter[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m([0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;190;132;255m5[0m[38;2;255;255;255m)[0m +[38;2;248;248;242m [0m[38;2;249;38;114m|>[0m[38;2;248;248;242m [0m[38;2;248;248;242mfold[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m([0m[38;2;249;38;114m+[0m[3;38;2;102;217;239m)[0m + +[38;2;248;248;242msetTimeout[0m[38;2;248;248;242m [0m[38;2;102;217;239m_[0m[38;2;248;248;242m, [0m[38;2;190;132;255m3000[0m[38;2;248;248;242m [0m[38;2;249;38;114m<|[0m[38;2;248;248;242m [0m[38;2;255;255;255mdo-stuff[0m +[38;2;102;217;239m_[0m[38;2;248;248;242m.[0m[38;2;102;217;239mmap[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;255;255;255m_abc[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;255;255;255m__[0m + + +[38;2;249;38;114mclass[0m[38;2;248;248;242m [0m[38;2;255;255;255mClass[0m[38;2;248;248;242m [0m[38;2;249;38;114mextends[0m[38;2;248;248;242m [0m[38;2;255;255;255mAnc-est-or[0m +[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255margs[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m->[0m + +[38;2;166;226;46mcop[0m[38;2;166;226;46my[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m, [0m[38;2;249;38;114mto[0m[38;2;248;248;242m, [0m[38;2;255;255;255mcallback[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m-->[0m +[38;2;248;248;242m [0m[38;2;255;255;255merror[0m[38;2;248;248;242m, [0m[38;2;255;255;255mdata[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m<-[0m[38;2;248;248;242m [0m[38;2;248;248;242mread[0m[38;2;248;248;242m [0m[38;2;255;255;255mfile[0m +[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;248;248;242mcallback[0m[38;2;248;248;242m [0m[38;2;255;255;255merror[0m[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255merror[0m[38;2;249;38;114m?[0m +[38;2;248;248;242m [0m[38;2;255;255;255merror[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m<~[0m[38;2;248;248;242m [0m[38;2;248;248;242mwrite[0m[38;2;248;248;242m [0m[38;2;255;255;255mfile[0m[38;2;248;248;242m, [0m[38;2;255;255;255mdata[0m +[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;248;248;242mcallback[0m[38;2;248;248;242m [0m[38;2;255;255;255merror[0m[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255merror[0m[38;2;249;38;114m?[0m +[38;2;248;248;242m [0m[38;2;248;248;242mcallback[0m[38;2;248;248;242m([0m[38;2;255;255;255m)[0m + +[38;2;248;248;242m$[0m[38;2;248;248;242m([0m[38;2;230;219;116m\[0m[38;2;230;219;116m#gafBr[0m[38;2;248;248;242m)[0m[38;2;248;248;242m.[0m[38;2;248;248;242mtext[0m[38;2;248;248;242m [0m[38;2;255;255;255m$t[0m[38;2;248;248;242m.[0m[38;2;248;248;242mfmtFloat[0m[38;2;248;248;242m([0m[38;2;255;255;255mefb[0m[38;2;248;248;242m.[0m[38;2;255;255;255mgaf[0m[38;2;255;255;255m)[0m + +[3;38;2;102;217;239m->[0m +[3;38;2;102;217;239m~>[0m +[3;38;2;102;217;239m~~>[0m +[3;38;2;102;217;239m-->[0m +[38;2;117;113;94m#[0m[38;2;117;113;94m Comment[0m +[38;2;117;113;94m/*[0m[38;2;117;113;94m Comment [0m[38;2;117;113;94m*/[0m +[38;2;117;113;94m#[0m[38;2;117;113;94m error, data <- read file[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m error, data <- read file [0m[38;2;117;113;94m*/[0m + +[38;2;166;226;46mad[0m[38;2;166;226;46md[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242ma[0m[38;2;249;38;114m=[0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;248;248;242mb[0m[38;2;249;38;114m=[0m[38;2;190;132;255m2[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m-->[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;255;255;255mb[0m +[38;2;248;248;242madd[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m +[38;2;248;248;242mdo-stuff[0m[38;2;249;38;114m![0m +[38;2;255;255;255mdo-stuff[0m[38;2;249;38;114m?[0m[38;2;248;248;242m [0m[38;2;117;113;94m#[0m +[38;2;248;248;242mdo-stuff[0m[38;2;249;38;114m?[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m +[38;2;255;255;255mdo-stuff[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m +[38;2;255;255;255m@[0m[38;2;248;248;242mdo-stuff[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m +[38;2;255;255;255m@[0m[38;2;255;255;255mdo-stuff[0m[38;2;248;248;242m [0m[38;2;249;38;114m/[0m[38;2;190;132;255m1[0m +[38;2;248;248;242ma[0m[38;2;248;248;242m [0m[38;2;248;248;242mb[0m[38;2;248;248;242m [0m[38;2;255;255;255mc[0m[38;2;248;248;242m [0m[38;2;249;38;114m|>[0m[38;2;248;248;242m [0m[38;2;255;255;255md[0m[38;2;248;248;242m [0m[38;2;249;38;114m<|[0m[38;2;248;248;242m [0m[38;2;248;248;242me[0m[38;2;248;248;242m [0m[38;2;248;248;242mf[0m[38;2;248;248;242m([0m[38;2;255;255;255mg[0m[38;2;255;255;255m)[0m +[38;2;230;219;116m'[0m[38;2;230;219;116mcats[0m[38;2;230;219;116m'[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mcats[0m[38;2;230;219;116m'[0m +[38;2;230;219;116m'[0m[38;2;230;219;116mcats[0m[38;2;230;219;116m'[0m[38;2;248;248;242m [0m[38;2;249;38;114m`[0m[38;2;102;217;239m_[0m[38;2;248;248;242m.[0m[38;2;248;248;242mis-insensitive[0m[38;2;249;38;114m`[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mCATS[0m[38;2;230;219;116m'[0m +[38;2;248;248;242msetTimeout[0m[38;2;248;248;242m [0m[38;2;102;217;239m_[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1000[0m[38;2;248;248;242m [0m[38;2;249;38;114m<|[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m!->[0m[38;2;248;248;242m [0m[38;2;166;226;46mconsole[0m[38;2;248;248;242m.[0m[38;2;248;248;242mlog[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mWho summoned me[0m[38;2;230;219;116m'[0m +[38;2;248;248;242mprivate-list[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114myield[0m[38;2;248;248;242m [0m[38;2;255;255;255m@[0m[38;2;248;248;242mget-private-list[0m[38;2;249;38;114m![0m +[38;2;249;38;114mswitch[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m#[0m[38;2;230;219;116m@@spaghetti[0m[38;2;230;219;116m"[0m +[3;38;2;102;217;239m~function[0m[38;2;248;248;242m [0m[38;2;166;226;46madd[0m[38;2;248;248;242m [0m[38;2;248;248;242ma[0m[38;2;249;38;114m=[0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;248;248;242mb[0m[38;2;249;38;114m=[0m[38;2;190;132;255m2[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;255;255;255mb[0m +[38;2;255;255;255mrow[0m[38;2;248;248;242m.[0m[38;2;190;132;255m0[0m[38;2;248;248;242m.[0m[38;2;255;255;255m_id[0m +[38;2;249;38;114mnew[0m[38;2;248;248;242m [0m[38;2;166;226;46mSpaghetti[0m +[38;2;255;255;255m([0m[38;2;249;38;114m++[0m[38;2;255;255;255ma[0m[38;2;249;38;114m++[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114m++[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;248;248;242m [0m[38;2;249;38;114m++[0m[38;2;255;255;255m)[0m +[3;38;2;102;217;239m([0m[38;2;248;248;242m.[0m[38;2;255;255;255mcool[0m[38;2;248;248;242m.[0m[3;38;2;102;217;239m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m([0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[3;38;2;102;217;239m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239m([0m[38;2;249;38;114m/[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[3;38;2;102;217;239m)[0m +[38;2;255;255;255m([0m[38;2;248;248;242mina[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114min[0m[3;38;2;102;217;239m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[3;38;2;102;217;239m->[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;255;255;255m)[0m +[38;2;255;255;255m([0m[38;2;255;255;255mina[0m[38;2;248;248;242m [0m[38;2;249;38;114min[0m[38;2;255;255;255m$a[0m[38;2;255;255;255m)[0m +[38;2;255;255;255m([0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;255;255;255mis-in[0m[38;2;255;255;255m)[0m +[3;38;2;102;217;239m([0m[38;2;249;38;114min[0m[3;38;2;102;217;239m)[0m +[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[3;38;2;102;217;239m([0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;248;248;242ma[0m[38;2;248;248;242m([0m[38;2;255;255;255m([0m[38;2;255;255;255ma[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m diff --git a/tests/syntax-tests/source/LiveScript/LICENSE.md b/tests/syntax-tests/source/LiveScript/LICENSE.md new file mode 100644 index 00000000..5c436445 --- /dev/null +++ b/tests/syntax-tests/source/LiveScript/LICENSE.md @@ -0,0 +1,23 @@ +The `livescript-demo.ls` file has been added from https://github.com/paulmillr/LiveScript.tmbundle under the following license: + +The MIT License (MIT) + +Copyright (c) 2012 Paul Miller (http://paulmillr.com/), Jeremy Ashkenas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tests/syntax-tests/source/LiveScript/livescript-demo.ls b/tests/syntax-tests/source/LiveScript/livescript-demo.ls new file mode 100644 index 00000000..dc34f8cf --- /dev/null +++ b/tests/syntax-tests/source/LiveScript/livescript-demo.ls @@ -0,0 +1,83 @@ +a = -> 1 +const b = --> 2 +var c = ~> 3 +d = ~~> +e = (a) -> (b) ~> (c) --> (d, e) ~~> 5 +dashes-identifiers = -> + a - a + b -- c + 1-1 1- -1 + a- a + a -a + +//abc #eaze #@ // +// +a #baze +// + +publi +if it is \abc and ($-y = !(a,) ->) ~= map //a#// +then match that | _ | otherwise => implements $("#abc #@a") + +switch |a=>b +| a then b + +if a => b else c + +underscores_i$d = -> +/regexp1/ and //regexp2//g +'strings' and "strings" and \strings +([2 til 10] or [1 to 50]) + |> map (* 2) + |> filter (> 5) + |> fold (+) + +setTimeout _, 3000 <| do-stuff +_.map; _abc; __ + + +class Class extends Anc-est-or + (args) -> + +copy = (from, to, callback) --> + error, data <- read file + return callback error if error? + error <~ write file, data + return callback error if error? + callback() + +$(\#gafBr).text $t.fmtFloat(efb.gaf) + +-> +~> +~~> +--> +# Comment +/* Comment */ +# error, data <- read file + /* error, data <- read file */ + +add = (a=1, b=2) --> a + b +add 1 2 +do-stuff! +do-stuff? # +do-stuff? 1 +do-stuff + 1 +@do-stuff +1 +@do-stuff /1 +a b c |> d <| e f(g) +'cats' is 'cats' +'cats' `_.is-insensitive` 'CATS' +setTimeout _, 1000 <| !-> console.log 'Who summoned me' +private-list = yield @get-private-list! +switch | true => "#@@spaghetti" +~function add a=1, b=2 => a + b +row.0._id +new Spaghetti +(++a++) (++ 2 ++) +(.cool.) (+ a -) (/ 2 *) +(ina -a in) (-> a) +(ina in$a) +(a is-in) +(in) +((((((+ a((a)))))))) |