An npm module for parsing Pomsky files, written in TypeScript.
This module is used for the VSCode extension.
import{parse}from'@pomsky-lang/parser'constpomskyExpression='"Hello, world!"'constast=parse(pomskyExpression)if(Array.isArray(ast)){thrownewError('Parse errors occurred')}import{tokenize}from'@pomsky-lang/parser/tokenizer'constpomskyExpression='"Hello, world!"'consttokens=tokenize(pomskyExpression)import{parse,tokenize}from'@pomsky-lang/parser'constpomskyExpression='"Hello, world!"'consttokens=tokenize(pomskyExpression)constast=parse(pomskyExpression,tokens)if(Array.isArray(ast)){thrownewError('Parse errors occurred')}The types for AST nodes (including const enums) can be imported from '@pomsky-lang/parser/rule'.
Pomsky is a passion project, so I rely on donations to make it financially sustainable. If you like this module, consider sponsoring my work on GitHub Sponsors.
- Make sure your code is formatted with prettier, passes
biome lint, and type-checks. We still have to add these checks to CI. - Please follow conventional commits.
- Please adhere to the code of conduct.
This parser is currently lacking unit and integration tests. If you want to contribute, integrating the Rust test suite would be a great way to start.
Dual-licensed under the MIT and Apache 2.0 license.