trystyncote / scripted-video

This is a project that attempts to produce an animation-looking video based on a given script.
MIT License
0 stars 0 forks source link

Upgrade the parser module to preserve all members of the script. #24

Closed trystyncote closed 1 year ago

trystyncote commented 1 year ago

Currently, the 'parser' module cuts some corners with its parsing. This behaviour is because of ease of implementation, but I would like not to continue this if I am to consider this project "completed". Because of this, I would like to upgrade the parser to not erase any data.

To do this, I have identified three situations where data is not preserved:

There are a number of means to fix this issue. One of the solutions that I think would work best is to instead yield a wrapper class that contains all relevant data about the respective line.

class <SomeWrapper>:
    def __init__(self, data):
        # stores the data
        ...

This way, I could in future configure the parser to return additional data (i.e. the line number), while not having to constantly rewrite tests to some new-length tuple, or configure the 'compile_time' module to work nice with it. All I would need is to add the logic for the new data when I need it.

trystyncote commented 1 year ago

Closed in response to #26.