mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-16 06:42:12 +00:00
Add a mechanism to enable additional (experimental) features and start with sign extension operations; Hashing experimentation
This commit is contained in:
11
src/index.ts
11
src/index.ts
@@ -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();
|
||||
|
Reference in New Issue
Block a user