bat/tests/syntax-tests/source/LiveScript/livescript-demo.ls
Martin Nordholts 6eb2cc9cac 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.
2021-10-23 13:35:32 +02:00

83 lines
1.3 KiB
Text
Vendored

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))))))))