Packages

Tree-sitter parser and queries for php, compiled to WASM for Lumis

Current section

Files

Jump to
Raw

README.md

# lumis_wasm_php

Self-contained Lumis language package for php.

The Tree-sitter parser is compiled to WASM and ships with the queries that highlight it.

Built with [`tree-sitter build --wasm`](https://tree-sitter.github.io/tree-sitter/cli/build.html) `v0.26.11`

[Lumis](https://lumis.sh) loads only the parsers a project depends on, so this dependency is what lets it highlight php.

## Installation

```elixir
def deps do
  [
    {:lumis, "~> 0.8"},
    {:lumis_wasm_php, "~> 0.26.0"}
  ]
end
```

## What it contains

`priv/parsers/` holds the parser and the manifest that describes it. The manifest records the parser's size, its SHA-256 and the queries.

Lumis reads both from there, so nothing is downloaded at runtime. `mix release` carries them like any dependency's assets.

The application has no code. It starts nothing and supervises nothing.

## Parser

| Parser | Version | Rev |
| ------ | ------- | --- |
| [https://github.com/tree-sitter/tree-sitter-php.git](https://github.com/tree-sitter/tree-sitter-php.git) | 0.24.2 | 5b5627faaa290d89eb3d01b9bf47c3bb9e797dea |

The same parser is published to npm as
[`@lumis-sh/wasm-php`](https://www.npmjs.com/package/@lumis-sh/wasm-php) — byte for byte,
from one build, so both registries serve the same artifact.

## License

The Lumis packaging is MIT. The parser itself is redistributed from the
upstream project above; see that project for its license.