Add a newline-sensitive lexer mode independent of indent #168
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| # Node 24+ runs the .ts sources directly (native type stripping) — no build, no tsx. | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - run: npm ci | |
| - name: Typecheck | |
| run: npx tsc --noEmit | |
| # Regenerate every grammar's artifacts and fail if any drifts from the committed | |
| # files (someone edited a grammar but forgot to regenerate). Covers all four | |
| # grammars (sources at the repo root) + the tree-sitter packages. | |
| - name: Generate editor artifacts (must be in sync) | |
| run: | | |
| npm run gen | |
| git diff --exit-code -- '*.tmLanguage.json' '*.language-configuration.json' '*.monarch.json' '*.cst-types.ts' '*.contributes.json' tree-sitter | |
| # Self-contained suites (each exits non-zero on failure). The conformance / | |
| # coverage / bench tools needing the external TypeScript corpus or VS Code's | |
| # grammar are excluded; tsx/jsx conformance use only the bundled tsc. | |
| - name: Test | |
| run: | | |
| node test/sanity-check.ts | |
| node test/agnostic.ts | |
| node test/refactor-guard.ts | |
| node test/test-issues.ts | |
| node test/tm-highlight-guards.ts | |
| node test/js-conformance.ts | |
| node test/tsx-conformance.ts | |
| node test/jsx-conformance.ts | |
| node test/redcmd-tm-diagnostics.ts | |
| node test/html-lexer-spike.ts | |
| node test/html-conformance.ts | |
| node test/html-monarch.ts | |
| node test/html-embed-js.ts | |
| node test/vue-directives.ts | |
| node test/vue-embed-boundary.ts | |
| node test/vue-interp-expr.ts | |
| # The derived tree-sitter highlighter is the strongest thesis proof (a real GLR | |
| # parser from the same grammar, beating the official hand-written one). Build its | |
| # wasm and gate the accuracy so the 95.9% is verified, not just claimed. The | |
| # tree-sitter CLI bundles its own wasm toolchain — no emscripten/docker needed. | |
| treesitter: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - run: npm ci | |
| # Cheap LR-conflict gate: `tree-sitter generate` (no wasm) for every derived | |
| # grammar that is a tree-sitter target, so a conflict introduced by a grammar | |
| # change is caught even for the dialects whose wasm is not built below (tsx/js/jsx) | |
| # — exactly the gap that let an unresolved `type`/`class_heritage` conflict ship. | |
| # yaml is excluded: its indentation tokens are not yet wired as tree-sitter | |
| # externals, so its generated grammar.js is not loadable (separate open issue). | |
| - name: Generate every derived tree-sitter grammar (conflict gate, no wasm) | |
| run: | | |
| for g in typescript typescriptreact javascript javascriptreact html; do | |
| echo "── tree-sitter generate: $g" | |
| ( cd "tree-sitter/$g" && npx tree-sitter generate ) | |
| done | |
| - name: Build the derived tree-sitter grammar to wasm | |
| run: | | |
| cd tree-sitter/typescript | |
| npx tree-sitter generate | |
| npx tree-sitter build --wasm . | |
| - name: Tree-sitter accuracy gate (≥ floor, must beat official) | |
| run: node test/treesitter-bench.ts | |
| - name: Build + gate the derived HTML tree-sitter grammar (v1, vs parse5) | |
| run: | | |
| cd tree-sitter/html | |
| npx tree-sitter generate | |
| npx tree-sitter build --wasm . | |
| cd ../.. | |
| node test/html-treesitter.ts |