mirror of
https://github.com/sharkdp/bat.git
synced 2025-06-30 12:13:23 +01:00
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.
This commit is contained in:
23
tests/syntax-tests/source/LiveScript/LICENSE.md
vendored
Normal file
23
tests/syntax-tests/source/LiveScript/LICENSE.md
vendored
Normal file
@ -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.
|
83
tests/syntax-tests/source/LiveScript/livescript-demo.ls
vendored
Normal file
83
tests/syntax-tests/source/LiveScript/livescript-demo.ls
vendored
Normal file
@ -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))))))))
|
Reference in New Issue
Block a user