pointlander / peg

Peg, Parsing Expression Grammar, is an implementation of a Packrat parser generator.
BSD 3-Clause "New" or "Revised" License
1.02k stars 121 forks source link

Make executable name static in generated code #138

Closed debugmiller closed 2 months ago

debugmiller commented 4 months ago

When using peg via go run the executable name is a path that changes every invocation. This PR hardcodes the first argument to peg so that subsequent runs of go run always generate the same output file.

Before

// Code generated by /var/folders/w2/fb613tqx6rzftr9k0v_pcfmr0000gn/T/go-build1383365192/b001/exe/peg grammar.peg DO NOT EDIT.

After

// Code generated by peg grammar.peg DO NOT EDIT.
sashamelentyev commented 2 months ago

@pointlander friendly ping. I need this too