# @lezer/cpp

> lezer-based C++ grammar

Latest version **1.1.6** (published 2026-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lezer/cpp
pnpm add @lezer/cpp
yarn add @lezer/cpp
bun add @lezer/cpp
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2026-05-28 |
| First published | 2021-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 440.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Marijn Haverbeke |
| Maintainers | marijn |

## Links

- npm: https://www.npmjs.com/package/@lezer/cpp
- Repository: https://code.haverbeke.berlin/lezer/cpp
- npm.io page: https://npm.io/package/@lezer/cpp

## Dependencies (3)

- [@lezer/lr](https://npm.io/package/@lezer/lr.md) ^1.0.0
- [@lezer/common](https://npm.io/package/@lezer/common.md) ^1.2.0
- [@lezer/highlight](https://npm.io/package/@lezer/highlight.md) ^1.0.0

## Recent versions

- 1.1.6 (latest) — 2026-05-28
- 1.1.5 — 2026-01-05
- 1.1.4 — 2025-12-09
- 1.1.3 — 2025-03-16
- 1.1.2 — 2023-12-28
- 1.1.1 — 2023-07-03
- 1.1.0 — 2023-02-08
- 1.0.0 — 2022-06-06
- 0.16.0 — 2022-04-20
- 0.15.3 — 2022-03-28
- 0.15.2 — 2022-01-24
- 0.15.1 — 2022-01-21
- 0.15.0 — 2021-08-11

## README

# @lezer/cpp

This is a C++ grammar for the
[Lezer](https://lezer.codemirror.net/) parser system.

The grammar used is based in a large part on the corresponding
[tree-sitter grammar](https://github.com/tree-sitter/tree-sitter-cpp).

It should be noted that really parsing C++ without a symbol table and
a preprocessor is not really something that is _possible_. The
language is very, very ambiguous when parsed like that. This grammar
tries to pick a likely parse, but is entirely capable of picking the
wrong one.

The code is licensed under an MIT license.

---
_Source: https://npm.io/package/@lezer/cpp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
