This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/snippets/jslt/test_sample.txt
João Abecasis a5808c2e50
Add support for JSLT (#1821)
* Add support for JSLT

JSLT is an open-source JSON query and transformation language, inspired
by jq, XPath, and XQuery: https://github.com/schibsted/jslt.

* fixup! Add support for JSLT

* fixup! Add support for JSLT
2021-07-18 10:50:25 +02:00

83 lines
2 KiB
Text

---input---
import "transforms/yellow.jslt" as yellow
// Known valid types
let valid-types = [ "SomeType" ]
def foobar(arg) $arg.foobar
{
"foobar": foobar(.),
"is-valid": contains(.type, $valid-types),
*: .
}
---tokens---
'import' Keyword.Namespace
' ' Text.Whitespace
'"transforms/yellow.jslt"' Literal.String.Symbol
' ' Text.Whitespace
'as' Keyword.Namespace
' ' Text.Whitespace
'yellow' Name.Namespace
'\n\n' Text.Whitespace
'// Known valid types\n' Comment.Single
'let' Keyword.Declaration
' ' Text.Whitespace
'valid-types' Name.Variable
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'[' Punctuation
' ' Text.Whitespace
'"SomeType"' Literal.String.Double
' ' Text.Whitespace
']' Punctuation
'\n\n' Text.Whitespace
'def' Keyword.Declaration
' ' Text.Whitespace
'foobar' Name.Function
'(' Punctuation
'arg' Name.Variable
')' Punctuation
' ' Text.Whitespace
'$arg' Name.Variable
'.' Operator
'foobar' Name
'\n\n' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'"foobar"' Literal.String.Double
':' Punctuation
' ' Text.Whitespace
'foobar' Name
'(' Punctuation
'.' Operator
')' Punctuation
',' Punctuation
'\n ' Text.Whitespace
'"is-valid"' Literal.String.Double
':' Punctuation
' ' Text.Whitespace
'contains' Name.Builtin
'(' Punctuation
'.' Operator
'type' Name
',' Punctuation
' ' Text.Whitespace
'$valid-types' Name.Variable
')' Punctuation
',' Punctuation
'\n ' Text.Whitespace
'*' Operator
':' Punctuation
' ' Text.Whitespace
'.' Operator
'\n' Text.Whitespace
'}' Punctuation
'\n' Text.Whitespace