You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove begin/end spec as part of the common prefix
When we define our own --markers='x-begin x-middle x-end', and our code contains as a first
character `x`, then that character will be considered part of the common prefix
and be removed from the code. Here's an example.
// cog-begin
// cog.outl('hello world')
// cog-middle
// cog-end
The common prefix for this code is `// cog`, which makes the code generator fail
because python will receive the code `.outl('hello world')`, which makes no
sense.
This issue is especially cumbersome to work with if you're invoking a module,
for instance:
// cog-begin
// codegen.generate_some_code()
// cog-middle
// cog-end
Here the python interpeter will receive `degen.generate_some_code()`.
This patch removes the begin and end specs from the marker line to avoid this
issue.
0 commit comments