Skip to content

feat: everyday syntax coverage and tolerant check - #26

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/hir-nodes
Sep 3, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/hir-nodes

Conversation

@SizzleUnrlsd

@SizzleUnrlsd SizzleUnrlsd commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Phase 1 item "Complete the PyHIR node set" (§3.2) and most of the open PyIR instructions (§6), plus a tolerant --check.

  • Acceptance tests first (test: define everyday syntax coverage and tolerant check), implementation follows.
  • PyHIR: parameters carry defaults and kinds (positional, keyword, var-positional, var-keyword), functions and classes carry decorators, AugAssign, assignment targets may be attributes, items or unpacked tuples, Tuple/List/Dict literals, BoolOp, chained comparisons (lowered to and), With/WithItem, Assert, keyword-argument unpacking, and HIR_SCHEMA_VERSION. Star arguments stay an explicit diagnostic.
  • Scope analysis binds with targets and unpacked names and evaluates defaults and decorators in the enclosing scope; import analysis walks with bodies.
  • CFG: a with body is laid out inline between synthetic EnterWith / ExitWith statements; an early exit skips the exit (no exception edges yet).
  • PyIR: Call keywords, SetAttr, SetItem, BuildList, BuildTuple, BuildDict, BoolOp, WithEnter, WithExit, Assert; operands and substitution recurse through nested tuples generically. Methods of module-level classes are lowered and named Class.method; other module-level statements are skipped instead of rejected.
  • Taint: keyword arguments are sink arguments and propagate like positional ones; list, tuple and dict literals propagate, so subprocess.run(["sh", "-c", cmd]) is caught.
  • --check no longer aborts on a function outside the subset: it emits an unsupported-syntax note (severity info) for that function and analyses the others. Plugins see only the analysable functions through PluginContext.functions().

Not in this PR: Try and exception edges, Lambda, Await/Yield, star arguments, nested function definitions (closures), which remain explicit diagnostics.

Part of #25: everything but await and yield, which stay open there with Try, Lambda, star arguments and closures.

@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 3, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit 68c2900 into main Sep 3, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/hir-nodes branch September 3, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant