summaryrefslogtreecommitdiff
path: root/tests/examplefiles/livescript-demo.ls
diff options
context:
space:
mode:
authorPaul Miller <paul@paulmillr.com>2012-08-07 13:55:09 +0300
committerPaul Miller <paul@paulmillr.com>2012-08-07 13:55:09 +0300
commit0fcb5d84dfb661fe8c0aebb4246880c15241e3b4 (patch)
treed6e448113a3535a4daf31bbbed104d2f1c4e2d60 /tests/examplefiles/livescript-demo.ls
parentf478863db22c67e92549fad4fb449593aca1f009 (diff)
downloadpygments-0fcb5d84dfb661fe8c0aebb4246880c15241e3b4.tar.gz
Fix coffee / ls stuff.
Diffstat (limited to 'tests/examplefiles/livescript-demo.ls')
-rw-r--r--tests/examplefiles/livescript-demo.ls21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/examplefiles/livescript-demo.ls b/tests/examplefiles/livescript-demo.ls
index a82a97f2..2ff68c63 100644
--- a/tests/examplefiles/livescript-demo.ls
+++ b/tests/examplefiles/livescript-demo.ls
@@ -1,6 +1,6 @@
a = -> [1 to 50]
const b = --> [2 til 5]
-var c = ~~> 10_000_000km * 500ms
+var c = ~~> 10_000_000km * 500ms - 16~ff / 32~lol
e = (a) -> (b) ~> (c) --> (d, e) ~~> <[list of words]>
dashes-identifiers = ->
a - a b -- c 1-1 1- -1 a- a a -a
@@ -14,11 +14,19 @@ underscores_i$d = ->
|> filter (> 5)
|> fold (+)
+obj =
+ prop1: 1
+ prop2: 2
+
class Class extends Anc-est-or
(args) ->
- -> ~> !-> !~> !--> !~~>
- <-! # Comment
- <~! /* Comment */
+ <- # Comment
+ <~ /* Comment */
+ void undefined yes no on off
+ a.void b.undefined c.off d.if f.no g.not
+ avoid bundefined coff dif fno gnot
+ "inter #{2 + 2} #variable"
+ '''HELLO 'world' '''
copy = (from, to, callback) -->
error, data <- read file
@@ -26,3 +34,8 @@ copy = (from, to, callback) -->
error <~ write file, data
return callback error if error?
callback()
+
+take(n, [x, ...xs]:list) =
+ | n <= 0 => []
+ | empty list => []
+ | otherwise => [x] +++ take n - 1, xs