mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 09:51:33 +00:00
Rename lib prefix to '~lib' (parens aren't valid); Add built-in alignof<T>; Prepare for ArrayBufferView
This commit is contained in:
14
src/ast.ts
14
src/ast.ts
@ -534,7 +534,7 @@ export abstract class Node {
|
||||
identifier: IdentifierExpression,
|
||||
typeParameters: TypeParameterNode[],
|
||||
extendsType: TypeNode | null, // can't be a function
|
||||
implementsTypes: TypeNode[], // can't be a function
|
||||
implementsTypes: TypeNode[] | null, // can't be functions
|
||||
members: DeclarationStatement[],
|
||||
decorators: DecoratorNode[] | null,
|
||||
flags: CommonFlags,
|
||||
@ -546,7 +546,7 @@ export abstract class Node {
|
||||
stmt.name = identifier; identifier.parent = stmt;
|
||||
stmt.typeParameters = typeParameters; setParent(typeParameters, stmt);
|
||||
stmt.extendsType = extendsType; if (extendsType) extendsType.parent = stmt;
|
||||
stmt.implementsTypes = implementsTypes; setParent(implementsTypes, stmt);
|
||||
stmt.implementsTypes = implementsTypes; if (implementsTypes) setParent(implementsTypes, stmt);
|
||||
stmt.members = members; setParent(members, stmt);
|
||||
stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);
|
||||
return stmt;
|
||||
@ -756,8 +756,10 @@ export abstract class Node {
|
||||
|
||||
static createInterfaceDeclaration(
|
||||
name: IdentifierExpression,
|
||||
typeParameters: TypeParameterNode[],
|
||||
extendsType: TypeNode | null, // can't be a function
|
||||
members: DeclarationStatement[],
|
||||
decorators: DecoratorNode[] | null,
|
||||
flags: CommonFlags,
|
||||
range: Range
|
||||
): InterfaceDeclaration {
|
||||
@ -765,8 +767,10 @@ export abstract class Node {
|
||||
stmt.range = range;
|
||||
stmt.flags = flags;
|
||||
stmt.name = name; name.parent = stmt;
|
||||
stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);
|
||||
stmt.extendsType = extendsType; if (extendsType) extendsType.parent = stmt;
|
||||
stmt.members = members; setParent(members, stmt);
|
||||
stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);
|
||||
return stmt;
|
||||
}
|
||||
|
||||
@ -1487,10 +1491,10 @@ export class ClassDeclaration extends DeclarationStatement {
|
||||
|
||||
/** Accepted type parameters. */
|
||||
typeParameters: TypeParameterNode[];
|
||||
/** Base class type being extended. */
|
||||
/** Base class type being extended, if any. */
|
||||
extendsType: TypeNode | null; // can't be a function
|
||||
/** Interface types being implemented. */
|
||||
implementsTypes: TypeNode[]; // can't be a function
|
||||
/** Interface types being implemented, if any. */
|
||||
implementsTypes: TypeNode[] | null; // can't be functions
|
||||
/** Class member declarations. */
|
||||
members: DeclarationStatement[];
|
||||
|
||||
|
Reference in New Issue
Block a user