Rename lib prefix to '~lib' (parens aren't valid); Add built-in alignof<T>; Prepare for ArrayBufferView

This commit is contained in:
dcodeIO
2018-04-02 19:05:26 +02:00
parent 3b50720603
commit 06198a3723
51 changed files with 2286 additions and 2209 deletions

View File

@ -85,7 +85,7 @@ export const INSTANCE_DELIMITER = "#";
/** Delimiter used between class and namespace names and static members. */
export const STATIC_DELIMITER = ".";
/** Substitution used to indicate a library directory. */
export const LIBRARY_SUBST = "(lib)";
export const LIBRARY_SUBST = "~lib";
/** Library directory prefix. */
export const LIBRARY_PREFIX = LIBRARY_SUBST + PATH_DELIMITER;
@ -417,23 +417,25 @@ export class Program extends DiagnosticEmitter {
this.elementsLookup.set(internalName, prototype);
var implementsTypes = declaration.implementsTypes;
var numImplementsTypes = implementsTypes.length;
if (prototype.is(CommonFlags.UNMANAGED)) {
if (implementsTypes && numImplementsTypes) {
this.error(
DiagnosticCode.Structs_cannot_implement_interfaces,
Range.join(
declaration.name.range,
implementsTypes[numImplementsTypes - 1].range
)
);
}
} else if (numImplementsTypes) {
for (let i = 0; i < numImplementsTypes; ++i) {
this.error(
DiagnosticCode.Operation_not_supported,
implementsTypes[i].range
);
if (implementsTypes) {
let numImplementsTypes = implementsTypes.length;
if (prototype.is(CommonFlags.UNMANAGED)) {
if (implementsTypes && numImplementsTypes) {
this.error(
DiagnosticCode.Structs_cannot_implement_interfaces,
Range.join(
declaration.name.range,
implementsTypes[numImplementsTypes - 1].range
)
);
}
} else if (numImplementsTypes) {
for (let i = 0; i < numImplementsTypes; ++i) {
this.error(
DiagnosticCode.Operation_not_supported,
implementsTypes[i].range
);
}
}
}