@hamelin.sh/compiler 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.d.ts +1 -1
- package/dist/main.js +4 -1
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ type AugmentedCompileResult = {
|
|
|
52
52
|
prettyRaw: string;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
declare const compileHamelin: (catalog: Catalog, hamelinInput: string) => Promise<AugmentedCompileResult>;
|
|
55
|
+
declare const compileHamelin: (catalog: Catalog, hamelinInput: string, timeRange?: string) => Promise<AugmentedCompileResult>;
|
|
56
56
|
|
|
57
57
|
declare const getFunctionDescriptions: () => Promise<FunctionDescription[]>;
|
|
58
58
|
|
package/dist/main.js
CHANGED
|
@@ -576,11 +576,14 @@ var initializeWasm = () => {
|
|
|
576
576
|
};
|
|
577
577
|
|
|
578
578
|
// src/compile-hamelin.ts
|
|
579
|
-
var compileHamelin = async (catalog, hamelinInput) => {
|
|
579
|
+
var compileHamelin = async (catalog, hamelinInput, timeRange) => {
|
|
580
580
|
await initializeWasm();
|
|
581
581
|
const catalogProvider = CatalogProvider.try_from_catalog(catalog);
|
|
582
582
|
const compiler = new Compiler();
|
|
583
583
|
compiler.set_catalog_provider(catalogProvider);
|
|
584
|
+
if (timeRange) {
|
|
585
|
+
compiler.set_time_range_expression(timeRange);
|
|
586
|
+
}
|
|
584
587
|
const result = compiler.compile_statement(hamelinInput);
|
|
585
588
|
if ("Ok" in result) {
|
|
586
589
|
return result;
|