highlights(hack): add keywords implements

This commit is contained in:
Stephan Seitz 2021-11-28 15:12:08 +01:00
parent cc0bdabe5f
commit 6a61461d18
4 changed files with 25 additions and 4 deletions

View file

@ -9,7 +9,7 @@ newtype T1 = ?shape(
// ^ attribute
type T2 = (function(T1): string);
// ^ type
// ^ function (cannot capture keyword "function" as keyword.function)
// TODO: keyword.function (currently not in AST)
<<A4(1), A5, A6(1,3,4)>>
newtype T3 as int = int;

View file

@ -8,6 +8,7 @@ class Box<T> {
public function __construct(T $data) {
// ^ type
// ^ parameter
// ^ keyword.function
// ^ keyword
// ^ method
$this->data = $data;

View file

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