mirror of
https://github.com/github/codeql.git
synced 2026-05-14 11:19:27 +02:00
Extend the desugaring config from a single flat list of rules to an
ordered sequence of named Phases. Each phase runs to completion (a
full traversal applying its rules) before the next phase starts.
Rules in different phases never compete for matches.
The config is built via the new chainable API:
DesugaringConfig::new()
.add_phase("cleanup", cleanup_rules)
.add_phase("desugar", desugar_rules)
.with_output_node_types_yaml(yaml);
Single-phase configs are just .add_phase(...) called once.
A single FreshScope is shared across phases so generated identifier
names (e.g. $tmp-N) are unique throughout the run.
Phase names appear in error messages, e.g. "Phase `desugar`:
exceeded maximum rewrite depth".
Add two regression tests: one verifying basic two-phase chained
desugaring, and one verifying that errors include the failing phase
name.
CodeQL Shared Libraries
This folder contains shared, language-agnostic CodeQL libraries.
Libraries are organized into separate query packs, in order to allow for
individual versioning. For example, the shared static single assignment (SSA)
library exists in the codeql/ssa pack, which can be referenced by adding
dependencies:
codeql/ssa: 0.0.1
to qlpack.yml.
All shared libraries will belong to a codeql/<name> pack, and live in the
namespace codeql.<name>.