Add a mechanism to enable additional (experimental) features and start with sign extension operations; Hashing experimentation

This commit is contained in:
dcodeIO
2018-05-08 00:36:19 +02:00
parent 00fee73022
commit 1bf0ca6525
17 changed files with 2337 additions and 1935 deletions

View File

@@ -6,7 +6,8 @@
import {
Compiler,
Options,
Target
Target,
Feature
} from "./compiler";
import {
@@ -129,6 +130,14 @@ export function setGlobalAlias(options: Options, name: string, alias: string): v
globalAliases.set(name, alias);
}
/** Sign extension operations. */
export const FEATURE_SIGNEXT = Feature.SIGNEXT;
/** Enables a specific feature. */
export function enableFeature(options: Options, feature: Feature): void {
options.features |= feature;
}
/** Finishes parsing. */
export function finishParsing(parser: Parser): Program {
return parser.finish();