mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-26 15:32:16 +00:00
Moved AST serialization to extra (not ultimately needed by asc)
This commit is contained in:
parent
f2ba4b4a76
commit
d1fed692f6
1
src/README.md
Normal file
1
src/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Portable compiler sources that compile to both JavaScript using `tsc` and, eventually, WebAssembly using `asc`.
|
951
src/ast.ts
951
src/ast.ts
File diff suppressed because it is too large
Load Diff
@ -275,17 +275,17 @@ export class Compiler extends DiagnosticEmitter {
|
|||||||
var statement = source.statements[i];
|
var statement = source.statements[i];
|
||||||
switch (statement.kind) {
|
switch (statement.kind) {
|
||||||
|
|
||||||
case NodeKind.CLASS:
|
case NodeKind.CLASSDECLARATION:
|
||||||
if ((noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<ClassDeclaration>statement).modifiers)) && !(<ClassDeclaration>statement).typeParameters.length)
|
if ((noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<ClassDeclaration>statement).modifiers)) && !(<ClassDeclaration>statement).typeParameters.length)
|
||||||
this.compileClassDeclaration(<ClassDeclaration>statement, []);
|
this.compileClassDeclaration(<ClassDeclaration>statement, []);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.ENUM:
|
case NodeKind.ENUMDECLARATION:
|
||||||
if (noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<EnumDeclaration>statement).modifiers))
|
if (noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<EnumDeclaration>statement).modifiers))
|
||||||
this.compileEnumDeclaration(<EnumDeclaration>statement);
|
this.compileEnumDeclaration(<EnumDeclaration>statement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.FUNCTION:
|
case NodeKind.FUNCTIONDECLARATION:
|
||||||
if ((noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<FunctionDeclaration>statement).modifiers)) && !(<FunctionDeclaration>statement).typeParameters.length)
|
if ((noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<FunctionDeclaration>statement).modifiers)) && !(<FunctionDeclaration>statement).typeParameters.length)
|
||||||
this.compileFunctionDeclaration(<FunctionDeclaration>statement, []);
|
this.compileFunctionDeclaration(<FunctionDeclaration>statement, []);
|
||||||
break;
|
break;
|
||||||
@ -294,7 +294,7 @@ export class Compiler extends DiagnosticEmitter {
|
|||||||
this.compileSourceByPath((<ImportStatement>statement).normalizedPath, (<ImportStatement>statement).path);
|
this.compileSourceByPath((<ImportStatement>statement).normalizedPath, (<ImportStatement>statement).path);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.NAMESPACE:
|
case NodeKind.NAMESPACEDECLARATION:
|
||||||
if (noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<NamespaceDeclaration>statement).modifiers))
|
if (noTreeShaking || source.isEntry && hasModifier(ModifierKind.EXPORT, (<NamespaceDeclaration>statement).modifiers))
|
||||||
this.compileNamespaceDeclaration(<NamespaceDeclaration>statement);
|
this.compileNamespaceDeclaration(<NamespaceDeclaration>statement);
|
||||||
break;
|
break;
|
||||||
@ -608,27 +608,27 @@ export class Compiler extends DiagnosticEmitter {
|
|||||||
var member = members[i];
|
var member = members[i];
|
||||||
switch (member.kind) {
|
switch (member.kind) {
|
||||||
|
|
||||||
case NodeKind.CLASS:
|
case NodeKind.CLASSDECLARATION:
|
||||||
if ((noTreeShaking || hasModifier(ModifierKind.EXPORT, (<ClassDeclaration>member).modifiers)) && !(<ClassDeclaration>member).typeParameters.length)
|
if ((noTreeShaking || hasModifier(ModifierKind.EXPORT, (<ClassDeclaration>member).modifiers)) && !(<ClassDeclaration>member).typeParameters.length)
|
||||||
this.compileClassDeclaration(<ClassDeclaration>member, []);
|
this.compileClassDeclaration(<ClassDeclaration>member, []);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.INTERFACE:
|
case NodeKind.INTERFACEDECLARATION:
|
||||||
if ((noTreeShaking || hasModifier(ModifierKind.EXPORT, (<InterfaceDeclaration>member).modifiers)) && !(<InterfaceDeclaration>member).typeParameters.length)
|
if ((noTreeShaking || hasModifier(ModifierKind.EXPORT, (<InterfaceDeclaration>member).modifiers)) && !(<InterfaceDeclaration>member).typeParameters.length)
|
||||||
this.compileInterfaceDeclaration(<InterfaceDeclaration>member, []);
|
this.compileInterfaceDeclaration(<InterfaceDeclaration>member, []);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.ENUM:
|
case NodeKind.ENUMDECLARATION:
|
||||||
if (noTreeShaking || hasModifier(ModifierKind.EXPORT, (<EnumDeclaration>member).modifiers))
|
if (noTreeShaking || hasModifier(ModifierKind.EXPORT, (<EnumDeclaration>member).modifiers))
|
||||||
this.compileEnumDeclaration(<EnumDeclaration>member);
|
this.compileEnumDeclaration(<EnumDeclaration>member);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.FUNCTION:
|
case NodeKind.FUNCTIONDECLARATION:
|
||||||
if ((noTreeShaking || hasModifier(ModifierKind.EXPORT, (<FunctionDeclaration>member).modifiers)) && !(<FunctionDeclaration>member).typeParameters.length)
|
if ((noTreeShaking || hasModifier(ModifierKind.EXPORT, (<FunctionDeclaration>member).modifiers)) && !(<FunctionDeclaration>member).typeParameters.length)
|
||||||
this.compileFunctionDeclaration(<FunctionDeclaration>member, []);
|
this.compileFunctionDeclaration(<FunctionDeclaration>member, []);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.NAMESPACE:
|
case NodeKind.NAMESPACEDECLARATION:
|
||||||
if (noTreeShaking || hasModifier(ModifierKind.EXPORT, (<NamespaceDeclaration>member).modifiers))
|
if (noTreeShaking || hasModifier(ModifierKind.EXPORT, (<NamespaceDeclaration>member).modifiers))
|
||||||
this.compileNamespaceDeclaration(<NamespaceDeclaration>member);
|
this.compileNamespaceDeclaration(<NamespaceDeclaration>member);
|
||||||
break;
|
break;
|
||||||
@ -3059,12 +3059,12 @@ function isModuleExport(element: Element, declaration: DeclarationStatement): bo
|
|||||||
var parentNode = declaration.parent;
|
var parentNode = declaration.parent;
|
||||||
if (!parentNode)
|
if (!parentNode)
|
||||||
return false;
|
return false;
|
||||||
if (declaration.range.source.isEntry && parentNode.kind != NodeKind.NAMESPACE)
|
if (declaration.range.source.isEntry && parentNode.kind != NodeKind.NAMESPACEDECLARATION)
|
||||||
return true;
|
return true;
|
||||||
if (parentNode.kind == NodeKind.VARIABLE)
|
if (parentNode.kind == NodeKind.VARIABLE)
|
||||||
if (!(parentNode = parentNode.parent))
|
if (!(parentNode = parentNode.parent))
|
||||||
return false;
|
return false;
|
||||||
if (parentNode.kind != NodeKind.NAMESPACE && parentNode.kind != NodeKind.CLASS)
|
if (parentNode.kind != NodeKind.NAMESPACEDECLARATION && parentNode.kind != NodeKind.CLASSDECLARATION)
|
||||||
return false;
|
return false;
|
||||||
var parent = element.program.elements.get((<DeclarationStatement>parentNode).internalName);
|
var parent = element.program.elements.get((<DeclarationStatement>parentNode).internalName);
|
||||||
if (!parent)
|
if (!parent)
|
||||||
|
1
src/extra/README.md
Normal file
1
src/extra/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Extra components that are not ultimately required in a standalone compiler.
|
1213
src/extra/ast.ts
Normal file
1213
src/extra/ast.ts
Normal file
File diff suppressed because it is too large
Load Diff
1
src/glue/README.md
Normal file
1
src/glue/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Environment specific glue code.
|
@ -156,11 +156,11 @@ export class Program extends DiagnosticEmitter {
|
|||||||
var statement = statements[j];
|
var statement = statements[j];
|
||||||
switch (statement.kind) {
|
switch (statement.kind) {
|
||||||
|
|
||||||
case NodeKind.CLASS:
|
case NodeKind.CLASSDECLARATION:
|
||||||
this.initializeClass(<ClassDeclaration>statement, queuedDerivedClasses);
|
this.initializeClass(<ClassDeclaration>statement, queuedDerivedClasses);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.ENUM:
|
case NodeKind.ENUMDECLARATION:
|
||||||
this.initializeEnum(<EnumDeclaration>statement);
|
this.initializeEnum(<EnumDeclaration>statement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ export class Program extends DiagnosticEmitter {
|
|||||||
this.initializeExports(<ExportStatement>statement, queuedExports);
|
this.initializeExports(<ExportStatement>statement, queuedExports);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.FUNCTION:
|
case NodeKind.FUNCTIONDECLARATION:
|
||||||
this.initializeFunction(<FunctionDeclaration>statement);
|
this.initializeFunction(<FunctionDeclaration>statement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -176,11 +176,11 @@ export class Program extends DiagnosticEmitter {
|
|||||||
this.initializeImports(<ImportStatement>statement, queuedExports, queuedImports);
|
this.initializeImports(<ImportStatement>statement, queuedExports, queuedImports);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.INTERFACE:
|
case NodeKind.INTERFACEDECLARATION:
|
||||||
this.initializeInterface(<InterfaceDeclaration>statement);
|
this.initializeInterface(<InterfaceDeclaration>statement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.NAMESPACE:
|
case NodeKind.NAMESPACEDECLARATION:
|
||||||
this.initializeNamespace(<NamespaceDeclaration>statement, queuedDerivedClasses, null);
|
this.initializeNamespace(<NamespaceDeclaration>statement, queuedDerivedClasses, null);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -327,11 +327,11 @@ export class Program extends DiagnosticEmitter {
|
|||||||
var memberDeclaration = memberDeclarations[i];
|
var memberDeclaration = memberDeclarations[i];
|
||||||
switch (memberDeclaration.kind) {
|
switch (memberDeclaration.kind) {
|
||||||
|
|
||||||
case NodeKind.FIELD:
|
case NodeKind.FIELDDECLARATION:
|
||||||
this.initializeField(<FieldDeclaration>memberDeclaration, prototype);
|
this.initializeField(<FieldDeclaration>memberDeclaration, prototype);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.METHOD:
|
case NodeKind.METHODDECLARATION:
|
||||||
var isGetter: bool;
|
var isGetter: bool;
|
||||||
if ((isGetter = hasModifier(ModifierKind.GET, memberDeclaration.modifiers)) || hasModifier(ModifierKind.SET, memberDeclaration.modifiers))
|
if ((isGetter = hasModifier(ModifierKind.GET, memberDeclaration.modifiers)) || hasModifier(ModifierKind.SET, memberDeclaration.modifiers))
|
||||||
this.initializeAccessor(<MethodDeclaration>memberDeclaration, prototype, isGetter);
|
this.initializeAccessor(<MethodDeclaration>memberDeclaration, prototype, isGetter);
|
||||||
@ -768,11 +768,11 @@ export class Program extends DiagnosticEmitter {
|
|||||||
var memberDeclaration = memberDeclarations[i];
|
var memberDeclaration = memberDeclarations[i];
|
||||||
switch (memberDeclaration.kind) {
|
switch (memberDeclaration.kind) {
|
||||||
|
|
||||||
case NodeKind.FIELD:
|
case NodeKind.FIELDDECLARATION:
|
||||||
this.initializeField(<FieldDeclaration>memberDeclaration, prototype);
|
this.initializeField(<FieldDeclaration>memberDeclaration, prototype);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.METHOD:
|
case NodeKind.METHODDECLARATION:
|
||||||
var isGetter: bool;
|
var isGetter: bool;
|
||||||
if ((isGetter = hasModifier(ModifierKind.GET, memberDeclaration.modifiers)) || hasModifier(ModifierKind.SET, memberDeclaration.modifiers))
|
if ((isGetter = hasModifier(ModifierKind.GET, memberDeclaration.modifiers)) || hasModifier(ModifierKind.SET, memberDeclaration.modifiers))
|
||||||
this.initializeAccessor(<MethodDeclaration>memberDeclaration, prototype, isGetter);
|
this.initializeAccessor(<MethodDeclaration>memberDeclaration, prototype, isGetter);
|
||||||
@ -818,23 +818,23 @@ export class Program extends DiagnosticEmitter {
|
|||||||
for (var i = 0, k = members.length; i < k; ++i) {
|
for (var i = 0, k = members.length; i < k; ++i) {
|
||||||
switch (members[i].kind) {
|
switch (members[i].kind) {
|
||||||
|
|
||||||
case NodeKind.CLASS:
|
case NodeKind.CLASSDECLARATION:
|
||||||
this.initializeClass(<ClassDeclaration>members[i], queuedExtendingClasses, namespace);
|
this.initializeClass(<ClassDeclaration>members[i], queuedExtendingClasses, namespace);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.ENUM:
|
case NodeKind.ENUMDECLARATION:
|
||||||
this.initializeEnum(<EnumDeclaration>members[i], namespace);
|
this.initializeEnum(<EnumDeclaration>members[i], namespace);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.FUNCTION:
|
case NodeKind.FUNCTIONDECLARATION:
|
||||||
this.initializeFunction(<FunctionDeclaration>members[i], namespace);
|
this.initializeFunction(<FunctionDeclaration>members[i], namespace);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.INTERFACE:
|
case NodeKind.INTERFACEDECLARATION:
|
||||||
this.initializeInterface(<InterfaceDeclaration>members[i], namespace);
|
this.initializeInterface(<InterfaceDeclaration>members[i], namespace);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NodeKind.NAMESPACE:
|
case NodeKind.NAMESPACEDECLARATION:
|
||||||
this.initializeNamespace(<NamespaceDeclaration>members[i], queuedExtendingClasses, namespace);
|
this.initializeNamespace(<NamespaceDeclaration>members[i], queuedExtendingClasses, namespace);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -249,60 +249,6 @@ export namespace Token {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function operatorToString(token: Token): string {
|
|
||||||
switch (token) {
|
|
||||||
case Token.DELETE: return "delete";
|
|
||||||
case Token.IN: return "in";
|
|
||||||
case Token.INSTANCEOF: return "instanceof";
|
|
||||||
case Token.NEW: return "new";
|
|
||||||
case Token.TYPEOF: return "typeof";
|
|
||||||
case Token.VOID: return "void";
|
|
||||||
case Token.YIELD: return "yield";
|
|
||||||
case Token.DOT_DOT_DOT: return "...";
|
|
||||||
case Token.COMMA: return ",";
|
|
||||||
case Token.LESSTHAN: return "<";
|
|
||||||
case Token.GREATERTHAN: return ">";
|
|
||||||
case Token.LESSTHAN_EQUALS: return "<=";
|
|
||||||
case Token.GREATERTHAN_EQUALS: return ">=";
|
|
||||||
case Token.EQUALS_EQUALS: return "==";
|
|
||||||
case Token.EXCLAMATION_EQUALS: return "!=";
|
|
||||||
case Token.EQUALS_EQUALS_EQUALS: return "===";
|
|
||||||
case Token.EXCLAMATION_EQUALS_EQUALS: return "!==";
|
|
||||||
case Token.PLUS: return "+";
|
|
||||||
case Token.MINUS: return "-";
|
|
||||||
case Token.ASTERISK_ASTERISK: return "**";
|
|
||||||
case Token.ASTERISK: return "*";
|
|
||||||
case Token.SLASH: return "/";
|
|
||||||
case Token.PERCENT: return "%";
|
|
||||||
case Token.PLUS_PLUS: return "++";
|
|
||||||
case Token.MINUS_MINUS: return "--";
|
|
||||||
case Token.LESSTHAN_LESSTHAN: return "<<";
|
|
||||||
case Token.GREATERTHAN_GREATERTHAN: return ">>";
|
|
||||||
case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: return ">>>";
|
|
||||||
case Token.AMPERSAND: return "&";
|
|
||||||
case Token.BAR: return "|";
|
|
||||||
case Token.CARET: return "^";
|
|
||||||
case Token.EXCLAMATION: return "!";
|
|
||||||
case Token.TILDE: return "~";
|
|
||||||
case Token.AMPERSAND_AMPERSAND: return "&&";
|
|
||||||
case Token.BAR_BAR: return "||";
|
|
||||||
case Token.EQUALS: return "=";
|
|
||||||
case Token.PLUS_EQUALS: return "+=";
|
|
||||||
case Token.MINUS_EQUALS: return "-=";
|
|
||||||
case Token.ASTERISK_EQUALS: return "*=";
|
|
||||||
case Token.ASTERISK_ASTERISK_EQUALS: return "**=";
|
|
||||||
case Token.SLASH_EQUALS: return "/=";
|
|
||||||
case Token.PERCENT_EQUALS: return "%=";
|
|
||||||
case Token.LESSTHAN_LESSTHAN_EQUALS: return "<<=";
|
|
||||||
case Token.GREATERTHAN_GREATERTHAN_EQUALS: return ">>=";
|
|
||||||
case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS: return ">>>=";
|
|
||||||
case Token.AMPERSAND_EQUALS: return "&=";
|
|
||||||
case Token.BAR_EQUALS: return "|=";
|
|
||||||
case Token.CARET_EQUALS: return "^=";
|
|
||||||
default: assert(false); return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isAlsoIdentifier(token: Token): bool {
|
export function isAlsoIdentifier(token: Token): bool {
|
||||||
switch (token) {
|
switch (token) {
|
||||||
case Token.ABSTRACT:
|
case Token.ABSTRACT:
|
||||||
|
@ -6,5 +6,8 @@
|
|||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./**/*.ts"
|
"./**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"./extra/**"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
3
std/README.md
Normal file
3
std/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Standard library components for use with `tsc` (portable) and `asc` (assembly).
|
||||||
|
|
||||||
|
Definition files (.d.ts) and base configurations (.json) are relevant to `tsc` only and not used by `asc`.
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../tsconfig-base.json"
|
|
||||||
}
|
|
@ -7,6 +7,7 @@ require("ts-node").register({ project: require("path").join(__dirname, "..", "sr
|
|||||||
require("../src/glue/js");
|
require("../src/glue/js");
|
||||||
|
|
||||||
var Parser = require("../src/parser").Parser;
|
var Parser = require("../src/parser").Parser;
|
||||||
|
var serializeSource = require("../src/extra/ast").serializeSource;
|
||||||
|
|
||||||
var isCreate = process.argv[2] === "--create";
|
var isCreate = process.argv[2] === "--create";
|
||||||
var filter = process.argv.length > 2 && !isCreate ? "*" + process.argv[2] + "*.ts" : "**.ts";
|
var filter = process.argv.length > 2 && !isCreate ? "*" + process.argv[2] + "*.ts" : "**.ts";
|
||||||
@ -25,7 +26,7 @@ glob.sync(filter, { cwd: __dirname + "/parser" }).forEach(filename => {
|
|||||||
parser.parseFile(sourceText, filename, true);
|
parser.parseFile(sourceText, filename, true);
|
||||||
|
|
||||||
var sb = [];
|
var sb = [];
|
||||||
parser.program.sources[0].serialize(sb);
|
serializeSource(parser.program.sources[0], sb);
|
||||||
var actual = sb.join("") + parser.diagnostics.map(diagnostic => "// " + diagnostic + "\n").join("");;
|
var actual = sb.join("") + parser.diagnostics.map(diagnostic => "// " + diagnostic + "\n").join("");;
|
||||||
var fixture = filename + ".fixture.ts";
|
var fixture = filename + ".fixture.ts";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
for (let i: i32 = 0; i < 10; ++i) {
|
for (var i: i32 = 0; i < 10; ++i) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
for (i = 0; i < 10; ++i) {
|
for (i = 0; i < 10; ++i) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
for (let i: i32 = 0; i < 10; ++i) {
|
for (var i: i32 = 0; i < 10; ++i) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
for (i = 0; i < 10; ++i) {
|
for (i = 0; i < 10; ++i) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
declare namespace A {
|
declare namespace A {
|
||||||
namespace B {
|
namespace B {
|
||||||
export namespace C {
|
export namespace C {
|
||||||
let aVar: i32;
|
var aVar: i32;
|
||||||
const aConst: i32 = 0;
|
const aConst: i32 = 0;
|
||||||
function aFunc(): void {}
|
function aFunc(): void {}
|
||||||
enum AnEnum {}
|
enum AnEnum {}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
declare namespace A {
|
declare namespace A {
|
||||||
namespace B {
|
namespace B {
|
||||||
export namespace C {
|
export namespace C {
|
||||||
let aVar: i32;
|
var aVar: i32;
|
||||||
const aConst: i32 = 0;
|
const aConst: i32 = 0;
|
||||||
function aFunc(): void {
|
function aFunc(): void {
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/(abc)\//ig;
|
/(abc)\//ig;
|
||||||
/(abc)\//;
|
/(abc)\//;
|
||||||
let re = /(abc)\//ig;
|
var re = /(abc)\//ig;
|
||||||
let noRe = !/(abc)\//i;
|
var noRe = !/(abc)\//i;
|
||||||
b / ig;
|
b / ig;
|
||||||
/(abc)\//iig;
|
/(abc)\//iig;
|
||||||
/(abc)\//iX;
|
/(abc)\//iX;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
var a: i32;
|
var a: i32;
|
||||||
let b: i32;
|
var b: i32;
|
||||||
const c: i32 = 0;
|
const c: i32 = 0;
|
||||||
let d = 2;
|
var d = 2;
|
||||||
|
|
||||||
let e; // type expected
|
var e; // type expected
|
||||||
const f: i32; // must be initialized
|
const f: i32; // must be initialized
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
let a: i32;
|
var a: i32;
|
||||||
let b: i32;
|
var b: i32;
|
||||||
const c: i32 = 0;
|
const c: i32 = 0;
|
||||||
let d = 2;
|
var d = 2;
|
||||||
let e;
|
var e;
|
||||||
const f: i32;
|
const f: i32;
|
||||||
// ERROR 1110: "Type expected." in var.ts @ 59,59
|
// ERROR 1110: "Type expected." in var.ts @ 59,59
|
||||||
// ERROR 1155: "'const' declarations must be initialized." in var.ts @ 84,85
|
// ERROR 1155: "'const' declarations must be initialized." in var.ts @ 84,85
|
||||||
|
Loading…
x
Reference in New Issue
Block a user