mirror of
https://github.com/github/codeql.git
synced 2026-06-09 23:14:13 +02:00
YEAST (YEAST Elaborates Abstract Syntax Trees) is a framework for
transforming tree-sitter parse trees before CodeQL extraction.
Core components:
- shared/yeast/ — Ast, Node, Schema, query matching engine, captures,
FreshScope, BuildCtx
- shared/yeast-macros/ — proc macros: query!, tree!, trees!, rule!
The query language is inspired by tree-sitter queries:
(assignment left: (_) @lhs right: (_) @rhs)
Templates support embedded Rust ({expr}), splicing ({..expr}),
computed literals (#{expr}), and fresh identifiers ($name).
The rule! macro combines query and transform:
rule!((for pattern: (_) @pat ...) => (call receiver: {val} ...))
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
16 lines
351 B
TOML
16 lines
351 B
TOML
[package]
|
|
name = "yeast"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
clap = { version = "4.4.10", features = ["derive"] }
|
|
serde = { version = "1.0.193", features = ["derive"] }
|
|
serde_json = "1.0.108"
|
|
serde_yaml = "0.9"
|
|
tree-sitter = ">= 0.23.0"
|
|
yeast-macros = { path = "../yeast-macros" }
|
|
|
|
tree-sitter-ruby = "0.23"
|
|
tree-sitter-python = "0.23"
|