skillfed

parser-development

This skill teaches you how to add parsing support for new languages to Biome by authoring grammars in ungrammar format, implementing lexers and token sources, and writing parse rules with robust error recovery. It covers list parsing patterns, conditional syntax handling, and testing workflows for the Biome codebase.

parser-development guides implementing parsers with error recovery for new languages in Biome using ungrammar grammar definitions.

AI-generated summary based on this skill's SKILL.md

25,418 1,157 Apache-2.0 updated by biomejs

Install

biomejs/biome/parser-development · repository language: Rust

git clone https://github.com/biomejs/biome
cp -r biome/.claude/skills/parser-development ~/.claude/skills/parser-development
npx skillfed install biomejs/biome/parser-development

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I implement a parser for a new language in Biome?

parser-development teaches you to implement a parser for a new language in Biome by starting with an ungram grammar definition, building a lexer and token source, then writing parse rules with error recovery. The process involves defining syntax rules in ungrammar format, implementing token handling, and adding bogus node patterns to gracefully recover from parse errors.

What are error recovery strategies in Biome parsers?

parser-development covers error recovery strategies in Biome parsers through techniques like bogus node handling, checkpoint backtracking, and recovery token sets. These strategies allow the parser to continue parsing after encountering syntax errors, maintaining a usable syntax tree and enabling better error diagnostics without stopping at the first mistake.

How do you create ungram grammar definitions and generate parser skeletons?

parser-development shows how to create ungram grammar definitions by writing syntax rules in ungrammar format, then generating parser skeletons from those definitions. The ungrammar format provides a declarative way to specify language syntax, which can be used to scaffold the initial parser structure before implementing the actual parsing logic.

How do I build a lexer and token source for Biome parsing?

parser-development teaches lexer and token source construction for Biome by covering buffered lexer implementation and token handling patterns. You'll learn to create token sources that feed the parser, manage token buffering for lookahead, and integrate lexical analysis with the parser's error recovery mechanisms.

What patterns does parser-development cover for parsing lists with separators?

parser-development covers list parsing patterns including separated list handling, which is essential for parsing comma-separated arguments, array elements, and similar constructs. These patterns integrate with error recovery to handle missing or malformed separators gracefully while maintaining parser resilience.

How do you test and validate Biome parser implementations?

parser-development includes testing workflows for validating parser implementations by checking recovery patterns, verifying syntax tree structure, and ensuring error diagnostics are accurate. The skill covers debugging techniques specific to the Biome codebase and validation strategies for confirming parsers handle both valid and malformed input correctly.

SKILL.md

rendered from the published skill — quoted content, verbatim

Purpose

Use this skill when creating or modifying Biome's parsers. Covers grammar authoring with ungrammar, lexer implementation, error recovery strategies, and list parsing patterns.

Prerequisites

  1. Install required tools: just install-tools
  2. Understand the language syntax you're implementing
  3. Read crates/biome_parser/CONTRIBUTING.md for detailed concepts

Common Workflows

Create Grammar for New Language

Create a .ungram file in xtask/codegen/ (e.g., html.ungram):

``` // html.ungram // Legend: // Name = -- non-terminal definition // 'ident' -- token (terminal) // A B -- sequence // A | B -- alternation // A* -- zero or more

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
.claude/skills/parser-development/SKILL.md

Related skills

Tags

language-implementation syntax-trees error-recovery lexical-analysis grammar-authoring token-parsing code-generation compiler-design ast-construction