chore(tests): consistent captures

This commit is contained in:
Christian Clason 2023-12-24 12:52:21 +01:00
parent 17fae3f4a3
commit 10dd49958c
60 changed files with 872 additions and 873 deletions

View file

@ -1,6 +1,6 @@
if (( $(tree-sitter parse test/Petalisp/**/*.lisp -q | wc -l) > 2 )); then if (( $(tree-sitter parse test/Petalisp/**/*.lisp -q | wc -l) > 2 )); then
# ^ punctuation.special # ^ @punctuation.special
# ^ punctuation.special # ^ @punctuation.special
# ^ punctuation.bracket # ^ @punctuation.bracket
exit 1 exit 1
fi fi

View file

@ -1,52 +1,52 @@
(ns test {:clj-kondo/ignore true}) (ns test {:clj-kondo/ignore true})
; <- punctuation.bracket ; <- @punctuation.bracket
; ^ include ; ^ @include
; ^ namespace ; ^ @namespace
; asdf ; asdf
;^^^^^^ comment ;^^^^^^ @comment
#_ abc #_ abc
;^^^^^^ comment ;^^^^^^ @comment
(func obj) (func obj)
;^^^^ function.call ;^^^^ @function.call
; ^^^ variable ; ^^^ @variable
#(+ % %1 %&) #(+ % %1 %&)
;^ punctuation.special ;^ @punctuation.special
; ^ function.call ; ^ @function.call
; ^ ^^ ^^ variable.builtin ; ^ ^^ ^^ @variable.builtin
& &
;^ parameter ;^ @parameter
->abc ->abc
;^^^^^ constructor ;^^^^^ @constructor
->>abc ->>abc
;^^^^^^ variable ;^^^^^^ @variable
*1 *2 *3 *e *1 *2 *3 *e
;^^ ^^ ^^ ^^ variable.builtin ;^^ ^^ ^^ ^^ @variable.builtin
(.method) (.method)
;^^^^^^^ method ;^^^^^^^ @method
(.-field) (.-field)
;^^^^^^^ field ;^^^^^^^ @field
Abc/method Abc/method
;^^^^^^^^^^ field ;^^^^^^^^^^ @field
(Abc/method) (Abc/method)
;^^^^^^^^^^ method ;^^^^^^^^^^ @method
Abc Abc
;^^^ type ;^^^ @type
abc. abc.
;^^^^ type ;^^^^ @type
^abc ^abc
;^ punctuation.special ;^ @punctuation.special

View file

@ -1,14 +1,14 @@
template <class T, class U> template <class T, class U>
concept Derived = std::is_base_of<U, T>::value; concept Derived = std::is_base_of<U, T>::value;
// ^ keyword // ^ @keyword
// ^ type.definition // ^ @type.definition
template<typename T> template<typename T>
concept Hashable = requires(T a) { concept Hashable = requires(T a) {
// ^ keyword // ^ @keyword
// ^ parameter // ^ @parameter
// ^ type // ^ @type
{ std::hash<T>{}(a) } -> std::convertible_to<std::size_t>; { std::hash<T>{}(a) } -> std::convertible_to<std::size_t>;
typename CommonType<T, U>; // CommonType<T, U> is valid and names a type typename CommonType<T, U>; // CommonType<T, U> is valid and names a type
{ CommonType<T, U>{std::forward<T>(t)} }; { CommonType<T, U>{std::forward<T>(t)} };
@ -18,5 +18,5 @@ concept Hashable = requires(T a) {
template<typename T> template<typename T>
requires requires (T x) { x + x; } // ad-hoc constraint, note keyword used twice requires requires (T x) { x + x; } // ad-hoc constraint, note keyword used twice
// ^ keyword // ^ @keyword
T add(T a, T b) { return a + b; } T add(T a, T b) { return a + b; }

View file

@ -1,19 +1,19 @@
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
// ^ include // ^ @include
// ^ string // ^ @string
auto main( int argc, char** argv ) -> int auto main( int argc, char** argv ) -> int
// ^ type.builtin // ^ @type.builtin
// ^ parameter // ^ @parameter
// ^ type.builtin // ^ @type.builtin
// ^ type.builtin // ^ @type.builtin
// ^ operator // ^ @operator
{ {
std::cout << "Hello world!" << std::endl; std::cout << "Hello world!" << std::endl;
// ^ punctuation.delimiter // ^ @punctuation.delimiter
return EXIT_SUCCESS; return EXIT_SUCCESS;
// ^ keyword.return // ^ @keyword.return
// ^ constant // ^ @constant
} }

View file

@ -1,32 +1,32 @@
class H { class H {
pub_field = "Hello"; pub_field = "Hello";
// ^ property // ^ @property
#priv_field = "World!"; #priv_field = "World!";
// ^ property // ^ @property
#private_method() { #private_method() {
// ^ method // ^ @method
return `${this.pub_field} -- ${this.#priv_field}`; return `${this.pub_field} -- ${this.#priv_field}`;
// ^ property // ^ @property
// ^ property // ^ @property
} }
public_method() { public_method() {
// ^ method // ^ @method
return this.#private_method(); return this.#private_method();
// ^ method.call // ^ @method.call
} }
ok() { ok() {
return this.public_method(); return this.public_method();
// ^ method.call // ^ @method.call
} }
} }
function doSomething(options) { function doSomething(options) {
const { const {
enable: on, enable: on,
// ^ punctuation.delimiter // ^ @punctuation.delimiter
} = options } = options
} }

View file

@ -1,60 +1,60 @@
include: SomeFile.fusion include: SomeFile.fusion
//<- include //<- @include
// ^text.uri // ^ @text.uri
namespace: ns = Neos.Fusion.Space namespace: ns = Neos.Fusion.Space
//<- keyword //<- @keyword
// ^namespace // ^ @namespace
// ^operator // ^ @operator
// ^namespace // ^ @namespace
prototype(MyType) < prototype(ns:SuperType) { prototype(MyType) < prototype(ns:SuperType) {
//<-keyword //<-keyword
// ^punctuation.bracket // ^ @punctuation.bracket
// ^type // ^ @type
// ^punctuation.bracket // ^ @punctuation.bracket
// ^operator // ^ @operator
// ^namespace // ^ @namespace
// ^type // ^ @type
deleteProp > deleteProp >
// ^operator // ^ @operator
string = 'value' string = 'value'
//<- property //<- @property
// ^operator // ^ @operator
// ^string // ^ @string
number = 10.2 number = 10.2
// ^number // ^ @number
null = null null = null
// ^constant.builtin // ^ @constant.builtin
boolean = true boolean = true
// ^boolean // ^ @boolean
property.inner = "value" property.inner = "value"
//<- property //<- @property
// ^property // ^ @property
property.@meta = "value" property.@meta = "value"
//<- property //<- @property
// ^attribute // ^ @attribute
property.type = SomeType property.type = SomeType
//<- property //<- @property
// ^type // ^ @type
property.aliasedType = ns:SomeType property.aliasedType = ns:SomeType
//<- property //<- @property
// ^namespace // ^ @namespace
// ^type // ^ @type
property.fullQualifiedType = SomeNamespace:SomeType property.fullQualifiedType = SomeNamespace:SomeType
//<- property //<- @property
// ^namespace // ^ @namespace
// ^type // ^ @type
} }

View file

@ -1,37 +1,37 @@
[attr]nodiff -diff -merge [attr]nodiff -diff -merge
# <- preproc # <- @preproc
# ^^^^^^ property # ^^^^^^ @property
# ^ operator # ^ @operator
# ^^^^ variable.builtin # ^^^^ @variable.builtin
# ^ operator # ^ @operator
# ^^^^^ variable.builtin # ^^^^^ @variable.builtin
vendor/** linguist-vendored=true vendor/** linguist-vendored=true
# ^ punctuation.delimiter # ^ @punctuation.delimiter
# ^^ character.special # ^^ @character.special
# ^^^^^^^^^^^^^^^^^ parameter # ^^^^^^^^^^^^^^^^^ @parameter
# ^ operator # ^ @operator
# ^^^^ boolean # ^^^^ @boolean
[^._]-[[:lower:]] !something [^._]-[[:lower:]] !something
# ^ punctuation.bracket # ^ @punctuation.bracket
# ^ operator # ^ @operator
# ^^ string.special # ^^ @string.special
# ^ punctuation.bracket # ^ @punctuation.bracket
# ^ punctuation.bracket # ^ @punctuation.bracket
# ^^^^^^^^^ constant # ^^^^^^^^^ @constant
# ^ punctuation.bracket # ^ @punctuation.bracket
# ^ operator # ^ @operator
# ^^^^^^^^^^ parameter # ^^^^^^^^^^ @parameter
"_\u4E00\t\56txt" encoding=UTF-16 "_\u4E00\t\56txt" encoding=UTF-16
# <- punctuation.special # <- @punctuation.special
# ^^^^^^ string.escape # ^^^^^^ @string.escape
# ^^ string.escape # ^^ @string.escape
# ^^^ string.escape # ^^^ @string.escape
# ^ punctuation.special # ^ @punctuation.special
# ^^^^^^^^ variable.builtin # ^^^^^^^^ @variable.builtin
# ^ operator # ^ @operator
# ^^^^^^ string # ^^^^^^ @string
# vim:ft=gitattributes: # vim:ft=gitattributes:

View file

@ -1,13 +1,13 @@
pub fn main() { pub fn main() {
assert Ok(i) = parse_int("123") assert Ok(i) = parse_int("123")
// <- exception // <- @exception
// ^^ constructor // ^^ @constructor
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ variable // ^ @variable
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ operator // ^ @operator
// ^^^^^^^^^ function.call // ^^^^^^^^^ @function.call
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^^^^ string // ^^^^^ @string
// ^ punctuation.bracket // ^ @punctuation.bracket
} }

View file

@ -1,127 +1,127 @@
pub fn add(x: Int, y: Int) -> Int { pub fn add(x: Int, y: Int) -> Int {
// <- type.qualifier // <- @type.qualifier
// ^^ keyword.function // ^^ @keyword.function
// ^^^ function // ^^^ @function
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ parameter // ^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ type.builtin // ^^^ @type.builtin
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^ parameter // ^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ type.builtin // ^^^ @type.builtin
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ type.builtin // ^^^ @type.builtin
// ^ punctuation.bracket // ^ @punctuation.bracket
} }
// <- punctuation.bracket // <- @punctuation.bracket
pub fn twice(f: fn(t) -> t, x: t) -> t { pub fn twice(f: fn(t) -> t, x: t) -> t {
// <- type.qualifier // <- @type.qualifier
// ^ keyword.function // ^ @keyword.function
// ^^^^^ function // ^^^^^ @function
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ parameter // ^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^ keyword.function // ^^ @keyword.function
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ type // ^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^ punctuation.delimiter // ^^ @punctuation.delimiter
// ^ type // ^ @type
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^ parameter // ^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^ type // ^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^ punctuation.delimiter // ^^ @punctuation.delimiter
// ^ type // ^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
} }
// <- punctuation.bracket // <- @punctuation.bracket
fn list_of_two(my_value: a) -> List(a) { fn list_of_two(my_value: a) -> List(a) {
// <- keyword.function // <- @keyword.function
// ^ function // ^ @function
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ parameter // ^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^ type // ^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^ type.builtin // ^^^^ @type.builtin
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ type // ^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ punctuation.bracket // ^ @punctuation.bracket
} }
// <- punctuation.bracket // <- @punctuation.bracket
fn replace( fn replace(
// <- keyword.function // <- @keyword.function
// ^^^^^^^ function // ^^^^^^^ @function
// ^ punctuation.bracket // ^ @punctuation.bracket
in string: String, in string: String,
// <- label // <- @label
// ^^^^^^ parameter // ^^^^^^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^ type.builtin // ^^^^^^ @type.builtin
// ^ punctuation.delimiter // ^ @punctuation.delimiter
each pattern: String, each pattern: String,
// <- label // <- @label
// ^^^^^^^ parameter // ^^^^^^^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^ type.builtin // ^^^^^^ @type.builtin
// ^ punctuation.delimiter // ^ @punctuation.delimiter
with replacement: String, with replacement: String,
// <- label // <- @label
// ^^^^^^^^^^^ parameter // ^^^^^^^^^^^ @parameter
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^ type.builtin // ^^^^^^ @type.builtin
// ^ punctuation.delimiter // ^ @punctuation.delimiter
) { ) {
replace(in: "A,B,C", each: ",", with: " ") replace(in: "A,B,C", each: ",", with: " ")
// <- function.call // <- @function.call
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^ label // ^^ @label
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^^ string // ^^^^^^^ @string
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^ label // ^^^^ @label
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ string // ^^^ @string
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^ label // ^^^^ @label
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ string // ^^^ @string
// ^ punctuation.bracket // ^ @punctuation.bracket
} }
// <- punctuation.bracket // <- @punctuation.bracket
pub external fn random_float() -> Float = "rand" "uniform" pub external fn random_float() -> Float = "rand" "uniform"
// <- type.qualifier // <- @type.qualifier
// ^^^^^^^^ type.qualifier // ^^^^^^^^ @type.qualifier
// ^^ keyword.function // ^^ @keyword.function
// ^^^^^^^^^^^^ function // ^^^^^^^^^^^^ @function
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^ punctuation.delimiter // ^^ @punctuation.delimiter
// ^^^^^ type.builtin // ^^^^^ @type.builtin
// ^ operator // ^ @operator
// ^^^^^^ namespace // ^^^^^^ @namespace
// ^^^^^^^^^ function // ^^^^^^^^^ @function
pub external fn inspect(a) -> a = "Elixir.IO" "inspect" pub external fn inspect(a) -> a = "Elixir.IO" "inspect"
// <- type.qualifier // <- @type.qualifier
// ^^^^^^^^ type.qualifier // ^^^^^^^^ @type.qualifier
// ^^ keyword.function // ^^ @keyword.function
// ^^^^^^^ function // ^^^^^^^ @function
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ type // ^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^ punctuation.delimiter // ^^ @punctuation.delimiter
// ^ type // ^ @type
// ^ operator // ^ @operator
// ^^^^^^^^^^^ namespace // ^^^^^^^^^^^ @namespace
// ^^^^^^^^^ function // ^^^^^^^^^ @function

View file

@ -1,22 +1,22 @@
import gleam/io import gleam/io
// <- include // <- @include
// ^ namespace // ^ @namespace
// ^ operator // ^ @operator
// ^ namespace // ^ @namespace
import cat as kitten import cat as kitten
// <- include // <- @include
// ^ namespace // ^ @namespace
// ^ keyword // ^ @keyword
// ^ namespace // ^ @namespace
import animal/cat.{Cat, stroke} import animal/cat.{Cat, stroke}
// <- include // <- @include
// ^ namespace // ^ @namespace
// ^ operator // ^ @operator
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^^ type // ^^^ @type
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^ function // ^^^^^^ @function
// ^ punctuation.bracket // ^ @punctuation.bracket

View file

@ -1,18 +1,18 @@
pub fn run() { pub fn run() {
1 1
// <- number // <- @number
|> add(_, 2) |> add(_, 2)
// <- operator // <- @operator
// ^^^ function.call // ^^^ @function.call
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ comment // ^ @comment
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^ number // ^ @number
// ^ punctuation.bracket // ^ @punctuation.bracket
|> add(3) |> add(3)
// <- operator // <- @operator
// ^^^ function.call // ^^^ @function.call
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ number // ^ @number
// ^ punctuation.bracket // ^ @punctuation.bracket
} }

View file

@ -1,7 +1,7 @@
fn favourite_number() -> Int { fn favourite_number() -> Int {
todo("We're going to decide which number is best tomorrow") todo("We're going to decide which number is best tomorrow")
// <- keyword // <- @keyword
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ string // ^ @string
// ^ punctuation.bracket // ^ @punctuation.bracket
} }

View file

@ -1,84 +1,84 @@
pub type Cat { pub type Cat {
// <- type.qualifier // <- @type.qualifier
// ^^^^ keyword // ^^^^ @keyword
// ^^^ type // ^^^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
Cat(name: String, cuteness: Int) Cat(name: String, cuteness: Int)
// <- constructor // <- @constructor
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^^^ property // ^^^^ @property
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^ type.builtin // ^^^^^^ @type.builtin
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^^^ property // ^^^^^^^^ @property
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ type.builtin // ^^^ @type.builtin
// ^ punctuation.bracket // ^ @punctuation.bracket
} }
fn cats() { fn cats() {
Cat(name: "Nubi", cuteness: 2001) Cat(name: "Nubi", cuteness: 2001)
// <- type // <- @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^^^ property // ^^^^ @property
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^ string // ^^^^^^ @string
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^^^ property // ^^^^^^^^ @property
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^ number // ^^^^ @number
// ^ punctuation.bracket // ^ @punctuation.bracket
Cat("Ginny", 1950) Cat("Ginny", 1950)
// <- constructor // <- @constructor
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^^^^^^ string // ^^^^^^^ @string
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^ number // ^^^^ @number
// ^ punctuation.bracket // ^ @punctuation.bracket
} }
type Box(inner_type) { type Box(inner_type) {
// <- keyword // <- @keyword
// ^^^ type // ^^^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^^^^^^^^^ type // ^^^^^^^^^^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^ punctuation.bracket // ^ @punctuation.bracket
Box(inner: inner_type) Box(inner: inner_type)
// <- constructor // <- @constructor
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^^^^ property // ^^^^^ @property
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^^^^^ type // ^^^^^^^^^^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
} }
pub opaque type Counter { pub opaque type Counter {
// <- type.qualifier // <- @type.qualifier
// ^^^^^^ type.qualifier // ^^^^^^ @type.qualifier
// ^^^^ keyword // ^^^^ @keyword
// ^^^^^^^ type // ^^^^^^^ @type
// ^ punctuation.bracket // ^ @punctuation.bracket
Counter(value: Int) Counter(value: Int)
} }
pub fn have_birthday(person) { pub fn have_birthday(person) {
Person(..person, age: person.age + 1, is_happy: True) Person(..person, age: person.age + 1, is_happy: True)
// <- constructor // <- @constructor
// ^ punctuation.bracket // ^ @punctuation.bracket
// ^^ operator // ^^ @operator
// ^^^^^^ variable // ^^^^^^ @variable
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ property // ^^^ @property
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^ variable // ^^^^^^ @variable
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^ property // ^^^ @property
// ^ operator // ^ @operator
// ^ number // ^ @number
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^^^^^ property // ^^^^^^^^ @property
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^^^^ boolean // ^^^^ @boolean
// ^ punctuation.bracket // ^ @punctuation.bracket
} }

View file

@ -1,6 +1,6 @@
foreach (($array as vec[]) as $item) {} foreach (($array as vec[]) as $item) {}
// ^ repeat // ^ @repeat
// ^ type // ^ @type
# Our expectation test for the code below intentionally includes an ERROR. # Our expectation test for the code below intentionally includes an ERROR.
foreach ($array as vec[] as $item) {} foreach ($array as vec[] as $item) {}

View file

@ -1,8 +1,8 @@
async function func0(): void {} async function func0(): void {}
// ^ type.builtin // ^ @type.builtin
async function func1<T1 as int>() {} async function func1<T1 as int>() {}
// ^ type.builtin // ^ @type.builtin
// ^ keyword.operator // ^ @keyword.operator
async ($x) ==> $x + 1; async ($x) ==> $x + 1;

View file

@ -2,13 +2,13 @@
newtype T1 = ?shape( newtype T1 = ?shape(
// TODO: ?operator (? not captureable at the moment) // TODO: ?operator (? not captureable at the moment)
?'int' => int ?'int' => int
// ^ operator // ^ @operator
); );
<<A3(1), A2(2,3,)>> <<A3(1), A2(2,3,)>>
// ^ attribute // ^ @attribute
type T2 = (function(T1): string); type T2 = (function(T1): string);
// ^ type // ^ @type
// TODO: keyword.function (currently not in AST) // TODO: keyword.function (currently not in AST)
<<A4(1), A5, A6(1,3,4)>> <<A4(1), A5, A6(1,3,4)>>

View file

@ -1,24 +1,24 @@
class Box<T> { class Box<T> {
// ^ type // ^ @type
// ^ type // ^ @type
protected T $data; protected T $data;
// ^ type.qualifier // ^ @type.qualifier
// ^ type // ^ @type
public function __construct(T $data) { public function __construct(T $data) {
// ^ type // ^ @type
// ^ parameter // ^ @parameter
// ^ keyword.function // ^ @keyword.function
// ^ type.qualifier // ^ @type.qualifier
// ^ method // ^ @method
$this->data = $data; $this->data = $data;
} }
public function getData(): T { public function getData(): T {
// ^ method // ^ @method
// ^ type.qualifier // ^ @type.qualifier
return $this->data; return $this->data;
// ^ operator // ^ @operator
// ^ variable.builtin // ^ @variable.builtin
} }
} }

View file

@ -1,4 +1,4 @@
<<<EOT <<<EOT
$('a') abc $(function{return;}) $('a') abc $(function{return;})
EOT; EOT;
// <- comment ^ comment // <- @comment ^ @comment

View file

@ -1,12 +1,12 @@
class C extends Superclass implements Iface { class C extends Superclass implements Iface {
// ^ keyword ^ keyword // ^ @keyword ^ @keyword
use Trait; use Trait;
// < include // <- @include
const type X = shape( const type X = shape(
// <- keyword ^ type.builtin // <- @keyword ^ @type.builtin
"a" => int, "a" => int,
// ^ string // ^ @string
"b" => string, "b" => string,
// ^ type.builtin // ^ @type.builtin
); );
} }

View file

@ -1,28 +1,28 @@
use const Space\Const\C; use const Space\Const\C;
// ^ keyword // ^ @keyword
// ^ constant // ^ @constant
use function Space\Func\F as E; use function Space\Func\F as E;
// ^ function // ^ @function
// ^ function // ^ @function
use type Space\Type\T; use type Space\Type\T;
// ^ keyword // ^ @keyword
use namespace Space\Name\N as M; use namespace Space\Name\N as M;
// ^ keyword // ^ @keyword
// ^ namespace // ^ @namespace
use namespace Space\Name2\N2, Space\Nothing\N3 as N8, type Space\Type2\N4,; use namespace Space\Name2\N2, Space\Nothing\N3 as N8, type Space\Type2\N4,;
// ^ namespace // ^ @namespace
// ^ type // ^ @type
use namespace Space\Name\N10\{A as A2, B\}; use namespace Space\Name\N10\{A as A2, B\};
// ^ namespace // ^ @namespace
// ^ namespace // ^ @namespace
// ^ namespace // ^ @namespace
use namespace Space\Name\{\C, Slash as Forward}; use namespace Space\Name\{\C, Slash as Forward};
use \What\Is\This\{function A as A2, B, const H\S\L as stdlib, function F}; use \What\Is\This\{function A as A2, B, const H\S\L as stdlib, function F};
use type \{kind,}; use type \{kind,};
use Q\B\{kind2,}; use Q\B\{kind2,};
// ^ namespace // ^ @namespace
use type Q\B\{kind3,}; use type Q\B\{kind3,};
// <- include // <- @include

View file

@ -1,3 +1,3 @@
using ($new = new Object(), $file = new File('using', '+using')) {} using ($new = new Object(), $file = new File('using', '+using')) {}
// <- keyword // <- @keyword
// ^ type // ^ @type

View file

@ -4,7 +4,7 @@ echo "<tt>Hello <strong>$user_name</tt></strong>";
// XHP: Typechecked, well-formed, and secure // XHP: Typechecked, well-formed, and secure
$user_name = 'Andrew'; $user_name = 'Andrew';
$xhp = <tt>Hello <strong>{$user_name}</strong></tt>; $xhp = <tt>Hello <strong>{$user_name}</strong></tt>;
// ^ tag // ^ @tag
// ^ tag // ^ @tag
// ^ string // ^ @string
echo await $xhp->toStringAsync(); echo await $xhp->toStringAsync();

View file

@ -1,59 +1,59 @@
HOCON = Human-Optimized Config Object Notation HOCON = Human-Optimized Config Object Notation
// ^field // ^ @field
// ^string // ^ @string
// ^string // ^ @string
// ^string // ^ @string
// ^string // ^ @string
"it's": "a JSON\nsuperset", "it's": "a JSON\nsuperset",
// ^string // ^ @string
// ^string.escape // ^ @string.escape
// ^punctuation.delimiter // ^ @punctuation.delimiter
features: [ features: [
// ^operator // ^ @operator
// ^punctuation.bracket // ^ @punctuation.bracket
less noisy / less pedantic syntax less noisy / less pedantic syntax
// ^string // ^ @string
ability to refer to another part of the configuration ability to refer to another part of the configuration
import/include another configuration file into the current file import/include another configuration file into the current file
a mapping to a flat properties list such as Java's system properties a mapping to a flat properties list such as Java's system properties
ability to get values from environment variables ability to get values from environment variables
# ability to write comments # ability to write comments
// ^comment // ^@ comment
// ^comment // ^ @comment
// this is also a comment // this is also a comment
// ^comment // ^ @comment
// ^comment // ^ @comment
] ]
specs url: "https://github.com/lightbend/config/blob/master/HOCON.md" specs url: "https://github.com/lightbend/config/blob/master/HOCON.md"
includes: { includes: {
include required(file("~/prog/tree-sitter-hocon/grammar.js")) include required(file("~/prog/tree-sitter-hocon/grammar.js"))
// ^keyword // ^ @keyword
//^include //^ @include
// ^punctuation.bracket // ^ @punctuation.bracket
// ^punctuation.bracket // ^ @punctuation.bracket
override = true override = true
// ^boolean // ^ @boolean
} }
it's: ${it's}. A ${HOCON} it's: ${it's}. A ${HOCON}
// ^punctuation.special // ^ @punctuation.special
// ^punctuation.special // ^ @punctuation.special
// ^punctuation.special // ^ @punctuation.special
// ^string // ^ @string
// ^string // ^ @string
// ^punctuation.special // ^ @punctuation.special
// ^punctuation.special // ^ @punctuation.special
this.is.a."long.key" = null, this.is.a."long.key" = null,
// ^punctuation.delimiter // ^ @punctuation.delimiter
// ^punctuation.delimiter // ^ @punctuation.delimiter
// ^punctuation.delimiter // ^ @punctuation.delimiter
// ^constant.builtin // ^ @constant.builtin
week = 7 days week = 7 days
// ^number // ^ @number
// ^keyword // ^ @keyword

View file

@ -1,26 +1,26 @@
function load_data(::Symbol; ::Int) :: Tuple function load_data(::Symbol; ::Int) :: Tuple
# <- keyword.function # <- @keyword.function
# ^ function # ^ @function
# ^ punctuation.bracket # ^ @punctuation.bracket
# ^^ punctuation.delimiter # ^^ @punctuation.delimiter
# ^ type.builtin # ^ @type.builtin
# ^ punctuation.delimiter # ^ @punctuation.delimiter
# ^^ punctuation.delimiter # ^^ @punctuation.delimiter
# ^^^ type.builtin # ^^^ @type.builtin
# ^ punctuation.bracket # ^ @punctuation.bracket
# ^^ punctuation.delimiter # ^^ @punctuation.delimiter
# ^ type.builtin # ^ @type.builtin
dataset = CIFAR10(; Tx = Float32, split = split) dataset = CIFAR10(; Tx = Float32, split = split)
# ^^^^^^^ variable # ^^^^^^^ @variable
# ^ operator # ^ @operator
# ^ function.call # ^ @function.call
# ^ operator # ^ @operator
# ^ type.builtin # ^ @type.builtin
X = reshape(dataset.features[:, :, :, begin:n_obs], :, n_obs) # flattening the image pixels X = reshape(dataset.features[:, :, :, begin:n_obs], :, n_obs) # flattening the image pixels
# ^^^^^ variable.builtin # ^^^^^ @variable.builtin
y = categorical2onehot(dataset.targets[begin:n_obs], N_LABELS) y = categorical2onehot(dataset.targets[begin:n_obs], N_LABELS)
# ^^^^^ variable.builtin # ^^^^^ @variable.builtin
return X, y return X, y
# ^^^^^^ keyword.return # ^^^^^^ @keyword.return
end end
# <- keyword.function # <- @keyword.function

View file

@ -1,18 +1,18 @@
-- luacheck: ignore -- luacheck: ignore
local a = { 1, 2, 3, 4, 5 } local a = { 1, 2, 3, 4, 5 }
-- ^ number ^ punctuation.bracket -- ^ @number ^ @punctuation.bracket
-- ^ variable -- ^ @variable
local _ = next(a) local _ = next(a)
-- ^ function.builtin -- ^ @function.builtin
-- ^ keyword -- ^ @keyword
_ = next(a) _ = next(a)
-- ^ function.builtin -- ^ @function.builtin
next(a) next(a)
-- ^ function.builtin -- ^ @function.builtin
-- Checking for incorrect hlgroup of injected luap -- Checking for incorrect hlgroup of injected luap
string.match(s, "\0%d[^\n]+") string.match(s, "\0%d[^\n]+")
-- ^ !constant -- ^ @!constant

View file

@ -1,28 +1,28 @@
# H1 # H1
<!-- <- text.title.1.marker --> <!-- <- @text.title.1.marker -->
## H2 ## H2
<!-- <- text.title.2.marker --> <!-- <- @text.title.2.marker -->
- Item 1 - Item 1
- Item 2 - Item 2
<!-- <- punctuation.special --> <!-- <- @punctuation.special -->
1. Item 1 1. Item 1
2. Item 2 2. Item 2
<!-- <- punctuation.special --> <!-- <- @punctuation.special -->
----![image_description](https://example.com/image.jpg "awesome image title") ----![image_description](https://example.com/image.jpg "awesome image title")
<!-- ^ text.reference --> <!-- ^ @text.reference -->
<!-- ^ text.uri --> <!-- ^ @text.uri -->
<!-- ^ text.literal --> <!-- ^ @text.literal -->
<!--^ punctuation.special --> <!--^ @punctuation.special -->
<!-- ^ punctuation.bracket --> <!-- ^ @punctuation.bracket -->
<!-- ^ punctuation.bracket --> <!-- ^ @punctuation.bracket -->
[link_text](#local_reference "link go brr...") [link_text](#local_reference "link go brr...")
<!-- ^ text.reference --> <!-- ^ @text.reference -->
<!-- ^ text.uri --> <!-- ^ @text.uri -->
<!-- ^ text.literal --> <!-- ^ @text.literal -->
<!-- <- punctuation.bracket --> <!-- <- @punctuation.bracket -->
<!-- ^ punctuation.bracket --> <!-- ^ @punctuation.bracket -->

View file

@ -1,39 +1,39 @@
program foobar; program foobar;
// ^ keyword // ^ @keyword
var var
// <- keyword // <- @keyword
foo: bar; foo: bar;
// ^ variable // ^ @variable
// ^ type // ^ @type
foo: foo.bar<t>; foo: foo.bar<t>;
// ^ variable // ^ @variable
// ^ type // ^ @type
// ^ type // ^ @type
// ^ type // ^ @type
begin begin
// ^ keyword // ^ @keyword
foo := bar; foo := bar;
// ^ variable // ^ @variable
// ^ variable // ^ @variable
foo; foo;
// ^ function // ^ @function
foo(); foo();
// ^ function // ^ @function
foo(bar(xyz)); foo(bar(xyz));
// ^ function // ^ @function
// ^ function // ^ @function
// ^ variable // ^ @variable
xx + yy; xx + yy;
// ^ variable // ^ @variable
// ^ variable // ^ @variable
xx := y + z + func(a, b, c); xx := y + z + func(a, b, c);
// ^ variable // ^ @variable
// ^ variable // ^ @variable
// ^ variable // ^ @variable
// ^ function // ^ @function
// ^ variable // ^ @variable
// ^ variable // ^ @variable
// ^ variable // ^ @variable
end. end.
// <- keyword // <- @keyword

View file

@ -1,51 +1,51 @@
match command.split(): match command.split():
# ^ conditional # ^ @conditional
case ["quit"]: case ["quit"]:
# ^ conditional # ^ @conditional
print("Goodbye!") print("Goodbye!")
quit_game() quit_game()
case ["look"]: case ["look"]:
# ^ conditional # ^ @conditional
current_room.describe() current_room.describe()
case ["get", obj]: case ["get", obj]:
# ^ conditional # ^ @conditional
character.get(obj, current_room) character.get(obj, current_room)
case ["go", direction]: case ["go", direction]:
# ^ conditional # ^ @conditional
current_room = current_room.neighbor(direction) current_room = current_room.neighbor(direction)
# The rest of your commands go here # The rest of your commands go here
match command.split(): match command.split():
# ^ conditional # ^ @conditional
case ["drop", *objects]: case ["drop", *objects]:
# ^ conditional # ^ @conditional
for obj in objects: for obj in objects:
character.drop(obj, current_room) character.drop(obj, current_room)
match command.split(): match command.split():
# ^ conditional # ^ @conditional
case ["quit"]: ... # Code omitted for brevity case ["quit"]: ... # Code omitted for brevity
case ["go", direction]: pass case ["go", direction]: pass
case ["drop", *objects]: pass case ["drop", *objects]: pass
case _: case _:
print(f"Sorry, I couldn't understand {command!r}") print(f"Sorry, I couldn't understand {command!r}")
# ^^ @function.macro # ^^ @@function.macro
match command.split(): match command.split():
# ^ conditional # ^ @conditional
case ["north"] | ["go", "north"]: case ["north"] | ["go", "north"]:
# ^ conditional # ^ @conditional
current_room = current_room.neighbor("north") current_room = current_room.neighbor("north")
case ["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"]: case ["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"]:
# ^ conditional # ^ @conditional
pass pass
match = 2 match = 2
# ^ variable # ^ @variable
match, a = 2, 3 match, a = 2, 3
# ^ variable # ^ @variable
match: int = secret match: int = secret
# ^ variable # ^ @variable
x, match: str = 2, "hey, what's up?" x, match: str = 2, "hey, what's up?"
# <- variable # <- @variable
# ^ variable # ^ @variable

View file

@ -1,12 +1,12 @@
use crate::a; use crate::a;
// ^ namespace // ^ @namespace
// ^ !keyword // ^ !keyword
use crate::{b, c}; use crate::{b, c};
// ^ namespace // ^ @namespace
// ^ !keyword // ^ !keyword
use super::a; use super::a;
// ^ namespace // ^ @namespace
// ^ !keyword // ^ !keyword
use super::{b, c}; use super::{b, c};
// ^ namespace // ^ @namespace
// ^ !keyword // ^ !keyword

View file

@ -1,27 +1,27 @@
// Example contract from official documentation at https://github.com/ethereum/solidity/blob/v0.8.12/docs/examples/voting.rst // Example contract from official documentation at https://github.com/ethereum/solidity/blob/v0.8.12/docs/examples/voting.rst
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
// ^ comment // ^ @comment
pragma solidity >=0.7.0 <0.9.0; pragma solidity >=0.7.0 <0.9.0;
// ^ preproc // ^ @preproc
// ^ preproc // ^ @preproc
import * as something from "anotherFile"; import * as something from "anotherFile";
// ^ ^ ^ include // ^ ^ ^ @include
/// @title Voting with delegation. /// @title Voting with delegation.
// <- comment // <- @comment
contract Ballot { contract Ballot {
// ^keyword // ^keyword
// ^ type // ^ @type
// This declares a new complex type which will // This declares a new complex type which will
// be used for variables later. // be used for variables later.
// It will represent a single voter. // It will represent a single voter.
struct Voter { struct Voter {
// ^ type // ^ @type
uint weight; // weight is accumulated by delegation uint weight; // weight is accumulated by delegation
// ^ type.builtin // ^ @type.builtin
// ^ field // ^ @field
bool voted; // if true, that person already voted bool voted; // if true, that person already voted
address delegate; // person delegated to address delegate; // person delegated to
uint vote; // index of the voted proposal uint vote; // index of the voted proposal
@ -34,23 +34,23 @@ contract Ballot {
} }
address public chairperson; address public chairperson;
// ^ type.builtin // ^ @type.builtin
// This declares a state variable that // This declares a state variable that
// stores a `Voter` struct for each possible address. // stores a `Voter` struct for each possible address.
mapping(address => Voter) public voters; mapping(address => Voter) public voters;
// ^ ^ punctuation.bracket // ^ ^ @punctuation.bracket
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// A dynamically-sized array of `Proposal` structs. // A dynamically-sized array of `Proposal` structs.
Proposal[] public proposals; Proposal[] public proposals;
enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill } enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }
// ^ constant // ^ @constant
/// Create a new ballot to choose one of `proposalNames`. /// Create a new ballot to choose one of `proposalNames`.
constructor(bytes32[] memory proposalNames) { constructor(bytes32[] memory proposalNames) {
// ^ constructor // ^ @constructor
chairperson = msg.sender; chairperson = msg.sender;
voters[chairperson].weight = 1; voters[chairperson].weight = 1;
@ -63,7 +63,7 @@ contract Ballot {
// appends it to the end of `proposals`. // appends it to the end of `proposals`.
proposals.push(Proposal({ proposals.push(Proposal({
name: proposalNames[i], name: proposalNames[i],
// ^ field // ^ @field
voteCount: 0 voteCount: 0
})); }));
} }
@ -72,9 +72,9 @@ contract Ballot {
// Give `voter` the right to vote on this ballot. // Give `voter` the right to vote on this ballot.
// May only be called by `chairperson`. // May only be called by `chairperson`.
function giveRightToVote(address voter) external { function giveRightToVote(address voter) external {
// ^ keyword.function // ^ @keyword.function
// ^ function // ^ @function
// ^ parameter // ^ @parameter
// If the first argument of `require` evaluates // If the first argument of `require` evaluates
// to `false`, execution terminates and all // to `false`, execution terminates and all
// changes to the state and to Ether balances // changes to the state and to Ether balances
@ -180,7 +180,7 @@ contract Ballot {
contract Another { contract Another {
Ballot b = new Ballot(new bytes32[](1)); Ballot b = new Ballot(new bytes32[](1));
// ^ keyword.operator // ^ @keyword.operator
} }
// vim:ft=solidity // vim:ft=solidity

View file

@ -1,10 +1,10 @@
// This is a comment // This is a comment
; <- comment ; <- @comment
; Another comment ; Another comment
; <- comment ; <- @comment
ECHO &a // This is a trailing comment ECHO &a // This is a trailing comment
; ^ comment ; ^ @comment
// vim: set ft=t32: // vim: set ft=t32:

View file

@ -1,123 +1,123 @@
PRIVATE &password PRIVATE &password
; <- keyword ; <- @keyword
; ^ variable.builtin ; ^ @variable.builtin
ENTRY &password ENTRY &password
; <- keyword ; <- @keyword
; ^ parameter ; ^ @parameter
ENTRY %LINE &salt ENTRY %LINE &salt
; <- keyword ; <- @keyword
; ^ constant.builtin ; ^ @constant.builtin
; ^ parameter ; ^ @parameter
IF "&password"=="" IF "&password"==""
; <- conditional ; <- @conditional
; ^ string ; ^ @string
; ^ variable.builtin ; ^ @variable.builtin
; ^ operator ; ^ @operator
( (
ECHO "Failed to provide password." ECHO "Failed to provide password."
ENDDO ENDDO
; ^ keyword.return ; ^ @keyword.return
) )
ELSE ELSE
; <- conditional ; <- @conditional
( (
PRIVATE &pass PRIVATE &pass
&pass=FALSE() &pass=FALSE()
; ^ function.builtin ; ^ @function.builtin
WHILE !&pass WHILE !&pass
; ^ operator ; ^ @operator
( (
GOSUB verify_password "&password" GOSUB verify_password "&password"
; ^ function.call ; ^ @function.call
RETURNVALUES &pass RETURNVALUES &pass
; ^ parameter ; ^ @parameter
WAIT 10.ms WAIT 10.ms
; ^ float ; ^ @float
) )
IF !&pass IF !&pass
GOTO fail GOTO fail
; ^ label ; ^ @label
ELSE ELSE
( (
GOSUB start_debug GOSUB start_debug
; ^ function.call ; ^ @function.call
) )
) )
LOCAL &num LOCAL &num
; ^ variable.builtin ; ^ @variable.builtin
&num = 2. &num = 2.
; ^ number ; ^ @number
RePeaT &num PRINT "Password: &password" RePeaT &num PRINT "Password: &password"
; ^ variable.builtin ; ^ @variable.builtin
; ^ variable.builtin ; ^ @variable.builtin
WinCLEAR WinCLEAR
FramePOS ,,,,Maximized FramePOS ,,,,Maximized
; ^ punctuation.delimiter ; ^ @punctuation.delimiter
; ^ constant.builtin ; ^ @constant.builtin
WinPOS 0% 50% 100% 35% WinPOS 0% 50% 100% 35%
; ^ float ; ^ @float
COVerage.ListFunc COVerage.ListFunc
ENDDO ENDDO
fail: fail:
; <- label ; <- @label
PRINT %ERROR "Password verification failed." PRINT %ERROR "Password verification failed."
END END
; ^ keyword.return ; ^ @keyword.return
verify_password: verify_password:
; <- function ; <- @function
( (
PARAMETERS &password PARAMETERS &password
; ^ parameter ; ^ @parameter
SYStem.Option.KEYCODE "&password" SYStem.Option.KEYCODE "&password"
SYStem.JtagClock 1kHz SYStem.JtagClock 1kHz
; ^ float ; ^ @float
SYStem.Mode.Attach SYStem.Mode.Attach
Data.Set N: EAXI:0x34000000 %Long 0x34000100 0x34000021 /verify Data.Set N: EAXI:0x34000000 %Long 0x34000100 0x34000021 /verify
; ^ constant.builtin ; ^ @constant.builtin
; ^ constant.builtin ; ^ @constant.builtin
; ^ number ; ^ @number
; ^ constant.builtin ; ^ @constant.builtin
; ^ number ; ^ @number
; ^ constant.builtin ; ^ @constant.builtin
RETURN TRUE() RETURN TRUE()
; ^ keyword.return ; ^ @keyword.return
) )
SUBROUTINE start_debug SUBROUTINE start_debug
; <- keyword.function ; <- @keyword.function
; ^ function ; ^ @function
( (
COVerage.ListModule %MULTI.OBC \sieve COVerage.ListModule %MULTI.OBC \sieve
; ^ keyword ; ^ @keyword
; ^ constant.builtin ; ^ @constant.builtin
; ^ symbol ; ^ @symbol
Var.DRAW flags[0..16] /Alternate 3 Var.DRAW flags[0..16] /Alternate 3
; ^ keyword ; ^ @keyword
; ^ variable ; ^ @variable
; ^ constant.builtin ; ^ @constant.builtin
; ^ number ; ^ @number
Go main Go main
RETURN RETURN
; ^ keyword.return ; ^ @keyword.return
) )
// vim: set ft=t32: // vim: set ft=t32:

View file

@ -1,39 +1,39 @@
WinPOS ,,1000.,,,,myWatchWindow WinPOS ,,1000.,,,,myWatchWindow
; ^ number ; ^ @number
PRinTer.OPEN "~~~/varwatch.txt" ASCIIE PRinTer.OPEN "~~~/varwatch.txt" ASCIIE
; ^ string ; ^ @string
sYmbol.NEW _InitialSP 0x34000100 sYmbol.NEW _InitialSP 0x34000100
; ^ number ; ^ @number
DO ~~~~/test.cmm DO ~~~~/test.cmm
; ^ string.special ; ^ @string.special
WAIT 1.ns WAIT 1.ns
; ^ float ; ^ @float
SYStem.JtagClock 100.GHZ SYStem.JtagClock 100.GHZ
; ^ float ; ^ @float
DATA.SET P:&HEAD+0x4 %LONG DATA.LONG(EA:&HEAD+0x4)&0xFFFFFF DATA.SET P:&HEAD+0x4 %LONG DATA.LONG(EA:&HEAD+0x4)&0xFFFFFF
; ^ constant.builtin ; ^ @constant.builtin
List `main` List `main`
; ^ symbol ; ^ @symbol
&range = 'a'--'z'||'0'--'9' &range = 'a'--'z'||'0'--'9'
; ^ character ; ^ @character
; ^ operator ; ^ @operator
; ^ character ; ^ @character
Data.Set N: 0xffff800000 0y0011xx01xx&&a Data.Set N: 0xffff800000 0y0011xx01xx&&a
; ^ constant.builtin ; ^ @constant.builtin
; ^ number ; ^ @number
; ^ number ; ^ @number
; ^ operator ; ^ @operator
WinPOS 0% 85% 100% 15% WinPOS 0% 85% 100% 15%
; ^ float ; ^ @float
// vim: set ft=t32: // vim: set ft=t32:

View file

@ -1,7 +1,7 @@
Var.NEWGLOBAL char[4][32] \myarr Var.NEWGLOBAL char[4][32] \myarr
; <- keyword ; <- @keyword
; ^ type.builtin ; ^ @type.builtin
; ^ variable.builtin ; ^ @variable.builtin
LOCAL &i &data LOCAL &i &data
&data="zero|one|two|three" &data="zero|one|two|three"
@ -12,64 +12,64 @@ WHILE &i<4
PRIVATE &val PRIVATE &val
&val=STRing.SPLIT("&data","|",&i) &val=STRing.SPLIT("&data","|",&i)
Var.Assign \myarr[&i]="&val" Var.Assign \myarr[&i]="&val"
; ^ variable.builtin ; ^ @variable.builtin
; ^ operator ; ^ @operator
&i=&i+1. &i=&i+1.
) )
Var.NEWLOCAL \x Var.NEWLOCAL \x
; <- keyword ; <- @keyword
; ^ variable.builtin ; ^ @variable.builtin
Var.set \x=func3(5,3) Var.set \x=func3(5,3)
; ^ variable.builtin ; ^ @variable.builtin
; ^ function.call ; ^ @function.call
; ^ number ; ^ @number
PRINT Var.VALUE(\x) PRINT Var.VALUE(\x)
; ^ variable.builtin ; ^ @variable.builtin
PRINT Var.VALUE('a') PRINT Var.VALUE('a')
; ^ character ; ^ @character
Var.Assign (*ap)[2..4] = &a Var.Assign (*ap)[2..4] = &a
; ^ variable ; ^ @variable
; ^ variable ; ^ @variable
Var.Assign sp = &s.n+offset Var.Assign sp = &s.n+offset
; ^ variable ; ^ @variable
; ^ variable ; ^ @variable
; ^ field ; ^ @field
; ^ variable ; ^ @variable
Var.Assign padd = (CAddition const * volatile)&d Var.Assign padd = (CAddition const * volatile)&d
; ^ variable ; ^ @variable
; ^ type ; ^ @type
; ^ type.qualifier ; ^ @type.qualifier
; ^ type.qualifier ; ^ @type.qualifier
; ^ variable ; ^ @variable
Var.Assign e1 = (enum e2)&e Var.Assign e1 = (enum e2)&e
; ^ variable ; ^ @variable
; ^ keyword ; ^ @keyword
; ^ type ; ^ @type
; ^ variable ; ^ @variable
Var.Assign *vector = (struct Vector3d*)&acceleration Var.Assign *vector = (struct Vector3d*)&acceleration
; ^ variable ; ^ @variable
; ^ keyword ; ^ @keyword
; ^ type ; ^ @type
; ^ variable ; ^ @variable
Var.Assign z = (union foo)x Var.Assign z = (union foo)x
; ^ variable ; ^ @variable
; ^ keyword ; ^ @keyword
; ^ type ; ^ @type
; ^ variable ; ^ @variable
Var.Assign b = -a Var.Assign b = -a
; ^ variable ; ^ @variable
; ^ variable ; ^ @variable
Var.Assign c = i++ Var.Assign c = i++
; ^ variable ; ^ @variable
; ^ variable ; ^ @variable
Var.Assign d = sizeof(int) Var.Assign d = sizeof(int)
; ^ variable ; ^ @variable
; ^ keyword.operator ; ^ @keyword.operator
; ^ type.builtin ; ^ @type.builtin
Var.call strcmp(key,buffer) Var.call strcmp(key,buffer)
; ^ function.call ; ^ @function.call
; ^ variable ; ^ @variable
; ^ variable ; ^ @variable
// vim: set ft=t32: // vim: set ft=t32:

View file

@ -1,21 +1,21 @@
let let
var a := exit(0) var a := exit(0)
/* ^ function.builtin */ /* ^ @function.builtin */
primitive exit(ret: int) /* Shadowing the prelude-included built-in */ primitive exit(ret: int) /* Shadowing the prelude-included built-in */
/* ^ type.builtin */ /* ^ @type.builtin */
var b := exit(0) var b := exit(0)
/* ^ function.builtin */ /* ^ @function.builtin */
type int = string /* Shadowing the built-in type */ type int = string /* Shadowing the built-in type */
/* ^ type.builtin */ /* ^ @type.builtin */
var c : int := "This is an \"int\"" var c : int := "This is an \"int\""
/* ^ type.builtin (not sure why it isn't 'type')*/ /* ^ @type.builtin (not sure why it isn't 'type')*/
var d : Object := nil var d : Object := nil
/* ^ type.builtin */ /* ^ @type.builtin */
type Object = int type Object = int
@ -23,22 +23,22 @@ let
in in
let let
var c : int := "This is an int" var c : int := "This is an int"
/* ^ type.builtin (not sure why it isn't 'type')*/ /* ^ @type.builtin (not sure why it isn't 'type')*/
var d : Object := "This is an object" var d : Object := "This is an object"
/* ^ type.builtin (not sure why it isn't 'type')*/ /* ^ @type.builtin (not sure why it isn't 'type')*/
in in
end; end;
exit(1); exit(1);
/* <- function.builtin */ /* <- @function.builtin */
print("shadowing is fun"); print("shadowing is fun");
/* <- function.builtin */ /* <- @function.builtin */
self; self;
/* <- variable.builtin */ /* <- @variable.builtin */
b := print b := print
/* ^ variable */ /* ^ @variable */
end end
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,6 +1,6 @@
/* This is /* a nested */ comment */ /* This is /* a nested */ comment */
/* <- comment /* <- @comment
^ comment ^ @comment
^ comment ^ @comment
*/ */
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,9 +1,9 @@
primitive print(s: string) primitive print(s: string)
/* ^ function */ /* ^ @function */
/* ^ parameter */ /* ^ @parameter */
function func(a: int) : int = (print("Hello World!"); a) function func(a: int) : int = (print("Hello World!"); a)
/* ^ function */ /* ^ @function */
/* ^ parameter */ /* ^ @parameter */
/* ^ function.builtin */ /* ^ @function.builtin */
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,30 +1,30 @@
type int = int type int = int
/* ^ variable */ /* ^ @variable */
/* ^ type.builtin */ /* ^ @type.builtin */
type int_array = array of int type int_array = array of int
/* ^ type.builtin */ /* ^ @type.builtin */
type record = {a: int, b: string} type record = {a: int, b: string}
/* ^ property */ /* ^ @property */
/* ^ type.builtin */ /* ^ @type.builtin */
/* ^ property */ /* ^ @property */
/* ^ type.builtin */ /* ^ @type.builtin */
var record := record {a = 12, b = "27"} var record := record {a = 12, b = "27"}
/* ^ variable */ /* ^ @variable */
/* ^ type */ /* ^ @type */
/* ^ property */ /* ^ @property */
/* ^ property */ /* ^ @property */
var array := int_array[12] of 27; var array := int_array[12] of 27;
/* ^ variable */ /* ^ @variable */
/* ^ type */ /* ^ @type */
primitive func(a: int, b: string) : array primitive func(a: int, b: string) : array
/* ^ parameter */ /* ^ @parameter */
/* ^ type.builtin */ /* ^ @type.builtin */
/* ^ parameter */ /* ^ @parameter */
/* ^ type.builtin */ /* ^ @type.builtin */
/* ^ type */ /* ^ @type */
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,4 +1,4 @@
import "lib.tih" import "lib.tih"
/* <- include */ /* <- @include */
/* ^ string.special */ /* ^ @string.special */
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,42 +1,42 @@
let let
/* <- keyword */ /* <- @keyword */
var a := 12 var a := 12
/* <- keyword */ /* <- @keyword */
function f() : int = a function f() : int = a
/* <- keyword.function */ /* <- @keyword.function */
primitive g() primitive g()
/* <- keyword.function */ /* <- @keyword.function */
import "lib.tih" import "lib.tih"
/* <- include */ /* <- @include */
type array_of_int = array of int type array_of_int = array of int
/* <- keyword */ /* <- @keyword */
/* ^ keyword */ /* ^ @keyword */
/* ^ keyword */ /* ^ @keyword */
in in
/* <- keyword */ /* <- @keyword */
12; 12;
if 12 then 27 else 42; if 12 then 27 else 42;
/* <- keyword */ /* <- @keyword */
/* ^ keyword */ /* ^ @keyword */
/* ^ keyword */ /* ^ @keyword */
for i := 12 to 27 do 42; for i := 12 to 27 do 42;
/* <- repeat */ /* <- @repeat */
/* ^ repeat */ /* ^ @repeat */
/* ^ repeat */ /* ^ @repeat */
while 12 do break while 12 do break
/* <- repeat */ /* <- @repeat */
/* ^ repeat */ /* ^ @repeat */
/* ^ keyword */ /* ^ @keyword */
end end
/* <- keyword */ /* <- @keyword */
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,9 +1,9 @@
nil nil
/* <- constant.builtin */ /* <- @constant.builtin */
42 42
/* <- number */ /* <- @number */
"Hello World!\n" "Hello World!\n"
/* <- string /* <- @string
^ string.escape ^ @string.escape
*/ */
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,14 +1,14 @@
let let
_chunks(42) _chunks(42)
/* <- keyword */ /* <- @keyword */
in in
_lvalue(12) : _namety(42) := _cast("I'm So Meta Even This Acronym", string); _lvalue(12) : _namety(42) := _cast("I'm So Meta Even This Acronym", string);
/* <- keyword */ /* <- @keyword */
/* ^ keyword */ /* ^ @keyword */
/* ^ keyword */ /* ^ @keyword */
_exp(42) _exp(42)
/* <- keyword */ /* <- @keyword */
end end
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,29 +1,29 @@
let let
class A extends Object {} class A extends Object {}
/* <- keyword */ /* <- @keyword */
/* ^ keyword */ /* ^ @keyword */
/* ^ type.builtin */ /* ^ @type.builtin */
type B = class extends A { type B = class extends A {
/* ^ keyword */ /* ^ @keyword */
/* ^ keyword */ /* ^ @keyword */
/* ^ type */ /* ^ @type */
var a := 12 var a := 12
method meth() : int = self.a method meth() : int = self.a
/* <- keyword.function */ /* <- @keyword.function */
/* ^ method */ /* ^ @method */
/* ^ variable.builtin */ /* ^ @variable.builtin */
} }
var object := new B var object := new B
/* ^ keyword.operator */ /* ^ @keyword.operator */
in in
object.a := 27; object.a := 27;
/* ^ property */ /* ^ @property */
object.meth() object.meth()
/* ^ method */ /* ^ @method */
end end
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,49 +1,49 @@
let let
var a : int := 42 var a : int := 42
/* ^ punctuation.delimiter */ /* ^ @punctuation.delimiter */
/* ^ operator */ /* ^ @operator */
in in
( (
/* <- punctuation.bracket */ /* <- @punctuation.bracket */
-1 | 2 & 3 + 4 * 5; -1 | 2 & 3 + 4 * 5;
/* <- operator */ /* <- @operator */
/* ^ operator */ /* ^ @operator */
/* ^ operator */ /* ^ @operator */
/* ^ operator */ /* ^ @operator */
/* ^ operator */ /* ^ @operator */
/* ^ punctuation.delimiter */ /* ^ @punctuation.delimiter */
12 >= 27; 12 >= 27;
/* ^ operator */ /* ^ @operator */
12 <= 27; 12 <= 27;
/* ^ operator */ /* ^ @operator */
12 = 27; 12 = 27;
/* ^ operator */ /* ^ @operator */
12 <> 27; 12 <> 27;
/* ^ operator */ /* ^ @operator */
12 < 27; 12 < 27;
/* ^ operator */ /* ^ @operator */
12 > 27; 12 > 27;
/* ^ operator */ /* ^ @operator */
record.field; record.field;
/* ^ punctuation.delimiter */ /* ^ @punctuation.delimiter */
func(a, b); func(a, b);
/* ^ punctuation.bracket */ /* ^ @punctuation.bracket */
/* ^ punctuation.bracket */ /* ^ @punctuation.bracket */
/* ^ punctuation.delimiter */ /* ^ @punctuation.delimiter */
record_type { }; record_type { };
/* ^ punctuation.bracket */ /* ^ @punctuation.bracket */
/* ^ punctuation.bracket */ /* ^ @punctuation.bracket */
array[42] array[42]
/* ^ punctuation.bracket */ /* ^ @punctuation.bracket */
/* ^ punctuation.bracket */ /* ^ @punctuation.bracket */
) )
/* <- punctuation.bracket */ /* <- @punctuation.bracket */
end end
/* vim: set ft=tiger: */ /* vim: set ft=tiger: */

View file

@ -1,8 +1,8 @@
import * as foo from 'foo'; import * as foo from 'foo';
// ^ include // ^ @include
export { foo as bar }; export { foo as bar };
// ^ include // ^ @include
const n = 5 as number; const n = 5 as number;
// ^ keyword.operator // ^ @keyword.operator

View file

@ -1,11 +1,11 @@
def Xform "cube" ( def Xform "cube" (
assetInfo = { assetInfo = {
# <- keyword # <- @keyword
asset[] payloadAssetDependencies = [@fizz.usd@, @buzz.usd@] asset[] payloadAssetDependencies = [@fizz.usd@, @buzz.usd@]
# <- type # <- @type
# ^ keyword # ^ @keyword
# ^ text.uri # ^ @text.uri
# ^ text.uri # ^ @text.uri
} }
) )
{ {
@ -13,13 +13,13 @@ def Xform "cube" (
def "root" ( def "root" (
add references = @foo.usda@</Model> (offset = 1; scale = 2.0) add references = @foo.usda@</Model> (offset = 1; scale = 2.0)
# <- text.uri # <- @text.uri
# ^ string.special # ^ @string.special
# ^ keyword # ^ @keyword
# ^ number # ^ @number
# ^ punctuation.delimiter # ^ @punctuation.delimiter
# ^ keyword # ^ @keyword
# ^ float # ^ @float
) )
{ {
} }
@ -28,14 +28,14 @@ def "World"
{ {
over "points" ( over "points" (
clips = { clips = {
# <- keyword # <- @keyword
dictionary default = { dictionary default = {
# <- type # <- @type
# ^ variable # ^ @variable
double2[] times = [(101, 101), (102, 102)] double2[] times = [(101, 101), (102, 102)]
# <- type # <- @type
# ^ keyword # ^ @keyword
# ^ number # ^ @number
} }
} }
) )
@ -49,9 +49,9 @@ def Xform "torch_2" (
) )
{ {
// Pre-published light list // Pre-published light list
# <- comment # <- @comment
rel lightList = [ <light> ] # inline comment rel lightList = [ <light> ] # inline comment
# ^ comment # ^ @comment
token lightList:cacheBehavior = "consumeAndContinue" token lightList:cacheBehavior = "consumeAndContinue"
double3 xformOp:translate = (1, 0, 0.5) double3 xformOp:translate = (1, 0, 0.5)
@ -60,7 +60,7 @@ def Xform "torch_2" (
def "foo" ( def "foo" (
"some comment" "some comment"
# <- comment.documentation # <- @comment.documentation
) )
{ {
} }
@ -68,20 +68,20 @@ def "foo" (
def "foo" ( def "foo" (
# inline comment # inline comment
"actual in-description comment" "actual in-description comment"
# <- comment.documentation # <- @comment.documentation
) )
{ {
} }
def "foo" ( def "foo" (
add references = @foo.usda@ add references = @foo.usda@
# <- function.call # <- @function.call
append references = @foo.usda@ append references = @foo.usda@
# <- function.call # <- @function.call
delete references = @foo.usda@ delete references = @foo.usda@
# <- function.call # <- @function.call
reorder references = [@foo.usda@] reorder references = [@foo.usda@]
# <- function.call # <- @function.call
references = [@foo.usda@] # explicit references = [@foo.usda@] # explicit
) )
@ -90,11 +90,11 @@ def "foo" (
over "Parent" ( over "Parent" (
prepend references = [</InternalRef>, @./ref.usda@</RefParent>] prepend references = [</InternalRef>, @./ref.usda@</RefParent>]
# <- function.call # <- @function.call
# ^ keyword # ^ @keyword
# ^ string.special # ^ @string.special
# ^ text.uri # ^ @text.uri
# ^ string.special # ^ @string.special
) )
{ {
} }
@ -102,17 +102,17 @@ over "Parent" (
def "foo" def "foo"
{ {
float value.timeSamples = { float value.timeSamples = {
# <- type # <- @type
# ^ variable # ^ @variable
# ^ property # ^ @property
-414: 14.4 -414: 14.4
# <- number # <- @number
# ^ float # ^ @float
10: 201.0, 10: 201.0,
# <- number # <- @number
# ^ float # ^ @float
10.123: 201.0123, 10.123: 201.0123,
# <- float # <- @float
# ^ float # ^ @float
} }
} }

View file

@ -1,21 +1,21 @@
dictionary foo = {} dictionary foo = {}
# <- type # <- @type
half[] foo = [2, 1, 2] half[] foo = [2, 1, 2]
# <- type # <- @type
string foo = "something" string foo = "something"
# <- type # <- @type
timecode time = 1.0 timecode time = 1.0
# <- type # <- @type
token[] purpose = ["default", "render"] token[] purpose = ["default", "render"]
# <- type # <- @type
rel material:binding:collection:Erasers = None rel material:binding:collection:Erasers = None
# <- type # <- @type
# ^ namespace # ^ @namespace
# ^ punctuation.delimiter # ^ @punctuation.delimiter
# ^ namespace # ^ @namespace
# ^ punctuation.delimiter # ^ @punctuation.delimiter
# ^ namespace # ^ @namespace
# ^ punctuation.delimiter # ^ @punctuation.delimiter
# ^ variable # ^ @variable
# ^ constant.builtin # ^ @constant.builtin

View file

@ -1,9 +1,9 @@
#usda 1.0 #usda 1.0
( (
subLayers = [ subLayers = [
# <- keyword # <- @keyword
@./model_sub.usda@ (offset = 1) @./model_sub.usda@ (offset = 1)
# <- text.uri # <- @text.uri
# ^ keyword # ^ @keyword
] ]
) )

View file

@ -1,19 +1,19 @@
bring cloud; bring cloud;
// <- keyword // <- @keyword
class Foo { class Foo {
// <- keyword // <- @keyword
// ^ variable // ^ @variable
// ^ punctuation.bracket // ^ @punctuation.bracket
name: str; name: str;
//^ field //^ @field
// ^ type.builtin // ^ @type.builtin
// ^ punctuation.delimiter // ^ @punctuation.delimiter
new(name: str) { new(name: str) {
//^ keyword //^ @keyword
// ^ variable // ^ @variable
this.name = name; this.name = name;
// ^ punctuation.delimiter // ^ @punctuation.delimiter
// ^ operator // ^ @operator
} }
} }

View file

@ -1,4 +1,4 @@
test1.test2.test3(); test1.test2.test3();
// <- variable // <- @variable
// ^ property // ^ @property
// ^ method.call // ^ @method.call

View file

@ -5,23 +5,23 @@ use type Facebook\XHP\HTML\{XHPHTMLHelpers, a, form};
final xhp class a_post extends x\element { final xhp class a_post extends x\element {
// ^ type.qualifier // ^ @type.qualifier
// ^ type.qualifier // ^ @type.qualifier
// ^ keyword // ^ @keyword
use XHPHTMLHelpers; use XHPHTMLHelpers;
attribute string href @required; attribute string href @required;
// ^ attribute // ^ @attribute
attribute string target; attribute string target;
// ^ keyword // ^ @keyword
<<__Override>> <<__Override>>
protected async function renderAsync(): Awaitable<x\node> { protected async function renderAsync(): Awaitable<x\node> {
$id = $this->getID(); $id = $this->getID();
$anchor = <a>{$this->getChildren()}</a>; $anchor = <a>{$this->getChildren()}</a>;
// ^ tag.delimiter // ^ @tag.delimiter
// ^ tag // ^ @tag
$form = ( $form = (
<form <form
id={$id} id={$id}
@ -38,7 +38,7 @@ final xhp class a_post extends x\element {
'document.getElementById("'.$id.'").submit(); return false;', 'document.getElementById("'.$id.'").submit(); return false;',
); );
$anchor->setAttribute('href', '#'); $anchor->setAttribute('href', '#');
// ^ method.call // ^ @method.call
return $form; return $form;
} }

View file

@ -1,2 +1,2 @@
#define FOO(X,Y) X + Y #define FOO(X,Y) X + Y
// ^ cuda // ^ @cuda

View file

@ -1,6 +1,6 @@
FROM foo FROM foo
RUN bar RUN bar
# ^ bash # ^ @bash
RUN \ RUN \
baz baz
# ^ bash # ^ @bash

View file

@ -1,9 +1,9 @@
html`<p></p>`; html`<p></p>`;
// ^ html // ^ @html
html(`<p></p>`); html(`<p></p>`);
// ^ html // ^ @html
svg`<p></p>`; svg`<p></p>`;
// ^ html // ^ @html
svg(`<p></p>`); svg(`<p></p>`);
// ^ html // ^ @html

View file

@ -6,50 +6,50 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet">
<style> footer{ } </style> <style> footer{ } </style>
<!-- ^ css --> <!-- ^ @css -->
<style title="Test Style without type attribute"> footer{ } </style> <style title="Test Style without type attribute"> footer{ } </style>
<!-- ^ css --> <!-- ^ @css -->
<style type="text/css" title="test style with defined type attribute"> footer{ } </style> <style type="text/css" title="test style with defined type attribute"> footer{ } </style>
<!-- ^ css --> <!-- ^ @css -->
</head> </head>
<body> <body>
<script> const x = 1 </script> <script> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script defer> const x = 1 </script> <script defer> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script async defer> const x = 1 </script> <script async defer> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script type="text/javascript"> const x = 1 </script> <script type="text/javascript"> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script type="text/ecmascript"> const x = 1 </script> <script type="text/ecmascript"> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script type="application/ecmascript"> const x = 1 </script> <script type="application/ecmascript"> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script type="application/javascript"> const x = 1 </script> <script type="application/javascript"> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script type="module"> import { foo } from "bar" </script> <script type="module"> import { foo } from "bar" </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script defer type="text/javascript"> const x = 1 </script> <script defer type="text/javascript"> const x = 1 </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script type="text/markdown">## Hello *World*!</script> <script type="text/markdown">## Hello *World*!</script>
<!-- ^ markdown --> <!-- ^ @markdown -->
<script type="application/graphql">query OK { dokey }</script> <script type="application/graphql">query OK { dokey }</script>
<!-- ^ graphql --> <!-- ^ @graphql -->
<script type="application/typescript">type A = number;</script> <script type="application/typescript">type A = number;</script>
<!-- ^ typescript --> <!-- ^ @typescript -->
<script type="application/json">{ "true": false }</script> <script type="application/json">{ "true": false }</script>
<!-- ^ json --> <!-- ^ @json -->
<script type="importmap">{ "true": false }</script> <script type="importmap">{ "true": false }</script>
<!-- ^ json --> <!-- ^ @json -->
<div style="height: 100%"> <div style="height: 100%">
<!-- ^ css --> <!-- ^ @css -->
Test div to test css injections for style attributes Test div to test css injections for style attributes
</div> </div>
<input pattern="[0-9]+"> <input pattern="[0-9]+">
<!-- ^ regex --> <!-- ^ @regex -->
<input pattern=[0-9]+ type="tel"> <input pattern=[0-9]+ type="tel">
<!-- ^ regex --> <!-- ^ @regex -->
</body> </body>
</html> </html>

View file

@ -1,23 +1,21 @@
<script> import Button from "./Button.svelte"; </script> <script> import Button from "./Button.svelte"; </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script lang="ts"> const foo: number = 1 </script> <script lang="ts"> const foo: number = 1 </script>
<!-- ^ typescript --> <!-- ^ @typescript -->
<!-- ^ !javascript --> <!-- ^ @!javascript -->
<style> main { font-family: sans-serif; text-align: center; } </style> <style> main { font-family: sans-serif; text-align: center; } </style>
<!-- ^ css --> <!-- ^ @css -->
<style lang="scss"> main { &:hover { } } </style> <style lang="scss"> main { &:hover { } } </style>
<!-- ^ scss --> <!-- ^ @scss -->
<!-- ^ !css --> <!-- ^ @!css -->
<main> <main>
<h1>Test file</h1> <h1>Test file</h1>
{#each someItems as someItem} {#each someItems as someItem}
<!-- ^ javascript <!-- ^ @javascript -->
-->
<div>{someItem}</div> <div>{someItem}</div>
<!-- ^ javascript <!-- ^ @javascript -->
-->
{/each} {/each}
<Button /> <Button />
<button on:click={() => foo++}></button> <button on:click={() => foo++}></button>

View file

@ -1,4 +1,4 @@
<script lang="ts"> const foo: number = "1" </script> <script lang="ts"> const foo: number = "1" </script>
<!-- ^ !javascript --> <!-- ^ @!javascript -->
<style lang="scss"> .bar { &-baz { &.page{ } } } </style> <style lang="scss"> .bar { &-baz { &.page{ } } } </style>
<!-- ^ !css --> <!-- ^ @!css -->

View file

@ -1,38 +1,39 @@
<template> <template>
<span>{{"Text inside interpolation"}}</span> <span>{{"Text inside interpolation"}}</span>
<!-- ^ typescript --> <!-- ^ @typescript -->
<template lang="pug"> a(:href="url") some link title in pug: </template> <template lang="pug"> a(:href="url") some link title in pug: </template>
<!-- ^ pug --> <!-- ^ @pug -->
<template v-if="'text inside directives'"></template> <template v-if="'text inside directives'"></template>
<!-- ^ typescript --> <!-- ^ @typescript -->
</template> </template>
<script> const foo = "1" </script> <script> const foo = "1" </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script defer> const foo = "1" </script> <script defer> const foo = "1" </script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script lang="js">function x(){ return 1;}</script> <script lang="js">function x(){ return 1;}</script>
<!-- ^ javascript --> <!-- ^ @javascript -->
<script lang="ts"> const foo: number = "1" </script> <script lang="ts"> const foo: number = "1" </script>
<!-- ^ typescript --> <!-- ^ @typescript -->
<!-- ^ !javascript --> <!-- ^ @!javascript -->
<script lang="ts" defer>const foo: number = 1 </script> <script lang="ts" defer>const foo: number = 1 </script>
<!-- ^ typescript --> <!-- ^ @typescript -->
<!-- ^ !javascript --> <!-- ^ @!javascript -->
<script lang="tsx" defer>const foo: number = 1</script> <script lang="tsx" defer>const foo: number = 1</script>
<!-- ^ tsx --> <!-- ^ @tsx -->
<!-- ^ !jsx --> <!-- ^ @!jsx -->
<!-- ^ !typescript --> <!-- ^ @!typescript -->
<style> .bar { .foo{ } } </style> <style> .bar { .foo{ } } </style>
<!-- ^ css --> <!-- ^ @css -->
<style scoped> .page.page--news { background: rebeccapurple; } </style> <style scoped> .page.page--news { background: rebeccapurple; } </style>
<!-- ^ css --> <!-- ^ @css -->
<style lang="css"> .bar { justify-content: center; } </style> <style lang="css"> .bar { justify-content: center; } </style>
<!-- ^ css --> <!-- ^ @css -->
<style lang="scss"> .bar { &-baz { } } </style> <style lang="scss"> .bar { &-baz { } } </style>
<!-- ^ scss --> <!-- ^ @scss -->
<!-- ^ !css --> <!-- ^ @!css -->
<style scoped lang="scss">body{} </style> <style scoped lang="scss">body{} </style>
<!-- ^ scss --> <!-- ^ @scss -->
<!-- ^ !css --> <!-- ^ @!css -->
// const file = files[0];

View file

@ -14,10 +14,10 @@ jobs:
node-version: '16' node-version: '16'
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
# ^ bash # ^ @bash
- name: Run tests - name: Run tests
run: npm test run: npm test
# ^ bash # ^ @bash
- name: Parse Petalisp - name: Parse Petalisp
run: | run: |
git submodule init git submodule init
@ -27,6 +27,6 @@ jobs:
else else
echo "Successfully parsed Petalisp" echo "Successfully parsed Petalisp"
fi fi
# ^ bash # ^ @bash
- name: Run tests - name: Run tests
run: npm test run: npm test

View file

@ -3,7 +3,7 @@ groups:
rules: rules:
- alert: Node down - alert: Node down
expr: up{job="node_exporter"} == 0 expr: up{job="node_exporter"} == 0
# ^ promql # ^ @promql
for: 3m for: 3m
labels: labels:
severity: warning severity: warning
@ -13,7 +13,7 @@ groups:
- alert: Node down - alert: Node down
expr: | expr: |
up{job="node_exporter"} == 0 up{job="node_exporter"} == 0
# ^ promql # ^ @promql
for: 3m for: 3m
labels: labels:
severity: warning severity: warning