pushfoo / pyc2e

A pure python interface for managing c2e instances and injecting CAOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add script injection support to the base CLI utility

pushfoo opened this issue · comments

commented

For now, a simple --add-script $FAMILY $GENUS $SPECIES $EVENT flag that doesn't attempt to intelligently extract data is probably best.
Trying to add fuller support for extracting from files will require more than simple regex as there might be endm, scrp, and rscr in comments.

commented

c2e appears to strip both comments and all newline spacing as scripts are injected into the scriptorium, as well as headers. This appears unrelated to outs as it can output newlines (try outs "first\nsecond" for a demo, credit to @gantt42 for helping sort through this).
It is probably safe to check for open/close markers and use those to detect script, removal script, etc. The main complication may be strings which might contain markers. Smart detection of scripts will have to be able to parse at least a little bit of caos.

commented

\" is a possible printable character that may arise, need to keep that in mind for parse as well.

\\ as well. "\\\"" and "\"" are valid.

commented

Current miniparser is actually broken, comment handling needs to account for quotes.

commented

It would be useful for the miniparser to differentiate between a scrp header that is malformed and one that is closed with an accompanying endm. Using r"(\d+(\s|\Z)+){4}" rather than a naive \s+for whitespace detection would achieve this.