Registry / serialization / firescript-parser

firescript-parser

JSON →
library0.15.0jsnpmunverified

The `firescript-parser` package provides a parser module for the Firescript language, designed to convert Firescript source code into an Abstract Syntax Tree (AST). As of its current version 0.15.0, both the language and its parser are actively under development and are not yet recommended for production use. Firescript itself is an indentation-based scripting language that compiles to clean, readable JavaScript, emphasizing strict syntax and dynamic typing. The parser's release cadence is irregular, closely tied to the evolving specifications of the Firescript language. Its primary differentiator is its specific utility for the Firescript ecosystem, rather than being a general-purpose parser for established languages.

npm install firescript-parser
INSTALL
IMPORT
SIG · FIRESCRIPT-PARSER
F
firescript-parser
serializationjavascriptv0.15.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Parser
✓ import Parser from 'firescript-parser'
✗ import { Parser } from 'firescript-parser'
The primary `Parser` class is exported as the default export.
Parser (CommonJS)
✓ const Parser = require('firescript-parser').default;
✗ const Parser = require('firescript-parser');
When using CommonJS, explicitly access the `.default` property for the Parser class due to ESM interoperability.
FirescriptParser (Class access)
✓ import Parser from 'firescript-parser'; new Parser()
✗ import FirescriptParser from 'firescript-parser'; new FirescriptParser()
While the class inside is often named `FirescriptParser`, the default import directly exposes it as `Parser` by convention.

Demonstrates how to import the `Parser` class, instantiate it, and parse a basic Firescript code snippet into an AST.

import Parser from 'firescript-parser'; const parser = new Parser(); try { const firescriptCode = "const foo = 'bar'\nlet baz = 10"; const ast = parser.parse(firescriptCode); console.log('Successfully parsed Firescript code.'); console.log(JSON.stringify(ast, null, 2)); // Example: Accessing part of the AST (structure may vary) // if (ast && ast.body && ast.body.length > 0) { // console.log('First statement type:', ast.body[0].type); // } } catch (error) { console.error('Parsing failed:', error.message); }
Debug
Known issues
breakingThe Firescript language and its parser are actively under development (version 0.15.0) and are not recommended for production use. Significant breaking changes to the API and AST structure are highly likely in future pre-1.0 releases as the language specification evolves.
fix
Monitor the project's GitHub repository for updates and changelogs. Pin exact versions of the package in your `package.json` to prevent unexpected breaks.
affects: >=0.1.0
gotchaThe official documentation for the Firescript language itself is 'not ready yet'. This indicates that detailed documentation for the parser's AST structure, specific syntax nuances, and advanced usage might be limited or informal, requiring direct source code inspection.
fix
Refer to the Firescript language's GitHub repository and the parser's source code for the most up-to-date understanding of syntax and AST structure.
affects: >=0.1.0
gotchaFirescript is a niche language. The parser is specific to Firescript and not compatible with standard JavaScript, TypeScript, or other common languages. Attempting to parse non-Firescript code will result in syntax errors.
fix
Ensure that the input provided to `firescript-parser` adheres strictly to the Firescript language syntax. Use appropriate parsers for other language types.
affects: >=0.1.0
Errors
Common errors & fixes
SyntaxError: Unexpected token
The input Firescript code contains a syntax error or uses features not yet supported by the parser.
fix
Review your Firescript code for syntax correctness according to the language specification. If the code is valid Firescript, the parser might be outdated or not yet support a specific language feature.
TypeError: Parser is not a constructor
The `Parser` class was imported incorrectly, often due to attempting a named import instead of the default export, or incorrect CommonJS usage.
fix
For ESM, use `import Parser from 'firescript-parser';`. For CommonJS, use `const Parser = require('firescript-parser').default;`.
Module not found: Can't resolve 'firescript-parser'
The `firescript-parser` package is not installed or not correctly linked in your project's dependencies.
fix
Run `npm install firescript-parser` or `yarn add firescript-parser` in your project directory.
Upgrade
Version history
0.15.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
firescript-parser — npm install firescript-parser · libregistry