UNPKG

greyscript-core

Version:
18 lines (17 loc) 839 B
import { ASTBase, ASTFunctionStatement } from 'miniscript-core'; import { Parser as ParserBase, ParserOptions as ParserOptionsBase } from 'greybel-core'; import { ASTChunkGreyScript, ASTImportCodeExpression, ASTProvider } from './parser/ast'; import Lexer from './lexer'; export interface ParserOptions extends ParserOptionsBase { astProvider?: ASTProvider; lexer?: Lexer; } export default class Parser extends ParserBase { nativeImports: ASTImportCodeExpression[]; astProvider: ASTProvider; constructor(content: string, options?: ParserOptions); parseStatement(): void; parseFunctionDeclaration(base: ASTBase, asLval?: boolean, statementStart?: boolean): ASTFunctionStatement | ASTBase; parseNativeImportCodeStatement(): ASTImportCodeExpression | ASTBase; parseChunk(): ASTChunkGreyScript | ASTBase; }