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
# ^ punctuation.special
# ^ punctuation.special
# ^ punctuation.bracket
# ^ @punctuation.special
# ^ @punctuation.special
# ^ @punctuation.bracket
exit 1
fi

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,28 +1,28 @@
use const Space\Const\C;
// ^ keyword
// ^ constant
// ^ @keyword
// ^ @constant
use function Space\Func\F as E;
// ^ function
// ^ function
// ^ @function
// ^ @function
use type Space\Type\T;
// ^ keyword
// ^ @keyword
use namespace Space\Name\N as M;
// ^ keyword
// ^ namespace
// ^ @keyword
// ^ @namespace
use namespace Space\Name2\N2, Space\Nothing\N3 as N8, type Space\Type2\N4,;
// ^ namespace
// ^ type
// ^ @namespace
// ^ @type
use namespace Space\Name\N10\{A as A2, B\};
// ^ namespace
// ^ namespace
// ^ namespace
// ^ @namespace
// ^ @namespace
// ^ @namespace
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 type \{kind,};
use Q\B\{kind2,};
// ^ namespace
// ^ @namespace
use type Q\B\{kind3,};
// <- include
// <- @include

View file

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

View file

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

View file

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

View file

@ -1,26 +1,26 @@
function load_data(::Symbol; ::Int) :: Tuple
# <- keyword.function
# ^ function
# ^ punctuation.bracket
# ^^ punctuation.delimiter
# ^ type.builtin
# ^ punctuation.delimiter
# ^^ punctuation.delimiter
# ^^^ type.builtin
# ^ punctuation.bracket
# ^^ punctuation.delimiter
# ^ type.builtin
# <- @keyword.function
# ^ @function
# ^ @punctuation.bracket
# ^^ @punctuation.delimiter
# ^ @type.builtin
# ^ @punctuation.delimiter
# ^^ @punctuation.delimiter
# ^^^ @type.builtin
# ^ @punctuation.bracket
# ^^ @punctuation.delimiter
# ^ @type.builtin
dataset = CIFAR10(; Tx = Float32, split = split)
# ^^^^^^^ variable
# ^ operator
# ^ function.call
# ^ operator
# ^ type.builtin
# ^^^^^^^ @variable
# ^ @operator
# ^ @function.call
# ^ @operator
# ^ @type.builtin
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)
# ^^^^^ variable.builtin
# ^^^^^ @variable.builtin
return X, y
# ^^^^^^ keyword.return
# ^^^^^^ @keyword.return
end
# <- keyword.function
# <- @keyword.function

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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