mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 06:51:34 +00:00
Fix handling of readonly/type as identifiers, see #115
This commit is contained in:
17
tests/parser/reserved-keywords.ts
Normal file
17
tests/parser/reserved-keywords.ts
Normal file
@ -0,0 +1,17 @@
|
||||
function alsoIdentifier(readonly: i32): void {}
|
||||
class AClass {
|
||||
constructor(readonly: i32) {}
|
||||
constructor(readonly readonly: i32) {}
|
||||
}
|
||||
|
||||
type type = i32;
|
||||
var type: i32;
|
||||
type = 123;
|
||||
|
||||
namespace namespace {}
|
||||
var namespace: i32;
|
||||
namespace = 123;
|
||||
|
||||
abstract class AClass {}
|
||||
var abstract: i32;
|
||||
abstract = 123;
|
14
tests/parser/reserved-keywords.ts.fixture.ts
Normal file
14
tests/parser/reserved-keywords.ts.fixture.ts
Normal file
@ -0,0 +1,14 @@
|
||||
function alsoIdentifier(readonly: i32): void {}
|
||||
class AClass {
|
||||
constructor(readonly: i32) {}
|
||||
constructor(readonly readonly: i32) {}
|
||||
}
|
||||
type type = i32;
|
||||
var type: i32;
|
||||
type = 123;
|
||||
namespace namespace {}
|
||||
var namespace: i32;
|
||||
namespace = 123;
|
||||
abstract class AClass {}
|
||||
var abstract: i32;
|
||||
abstract = 123;
|
Reference in New Issue
Block a user