Skip to content

Commit

Permalink
add Aison.parse type
Browse files Browse the repository at this point in the history
Co-authored-by: uzmoi <[email protected]>
  • Loading branch information
FineArchs and uzmoi authored Jan 12, 2025
1 parent 67bd115 commit bae8bdb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/parser/aison.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
/**
* AiSON: AiScript Object Notation
*/
import type { JsValue } from '../interpreter/util.js';
import { nodeToJs } from '../utils/node-to-js.js';
import { Scanner } from './scanner.js';
import { parseAiSonTopLevel } from './syntaxes/aison.js';

export class AiSON {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public static parse(input: string): any {
public static parse(input: string): JsValue {
const scanner = new Scanner(input);
const ast = parseAiSonTopLevel(scanner);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
return nodeToJs(ast) as any;
return nodeToJs(ast);
}
}

0 comments on commit bae8bdb

Please sign in to comment.