Skip to content

v0.0.17

Choose a tag to compare

@tamnd tamnd released this 27 Apr 08:09
· 105 commits to main since this release
v0.0.17
977fae6

v0.0.17

Replace the hand-rolled source scanner with gopapy/v2 as the parser.

compiler.Compile now calls parser2.ParseFile from
github.com/tamnd/gopapy/v2 and walks the resulting AST via the new
classifyAST function. All 88 oracle fixtures remain byte-identical.

One intentional behaviour change: raw-string literals (r"hi") used as
module docstrings are accepted. gopapy parses them identically to plain
strings; the produced bytecode is correct and byte-identical to CPython.

Files changed

  • go.mod / go.sum: add github.com/tamnd/gopapy/v2 v2.0.0.
  • compiler/classify_ast.go (new): classifyAST, extractValue,
    constantToValue, augOpargFromOp.
  • compiler/classify.go: remove all hand-scanner functions; keep types,
    utility functions, and stmtsToClassification.
  • compiler/compiler.go: update Compile to use parser2.ParseFile
    and classifyAST; update package doc.
  • compiler/compiler_test.go: drop raw_string from the rejected list.
  • cmd/gocopy/main.go: version bumped to 0.0.17.