Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Use a template language for Expression and Statement templates #15

Open
woodruffw opened this issue Aug 18, 2020 · 0 comments
Open

Use a template language for Expression and Statement templates #15

woodruffw opened this issue Aug 18, 2020 · 0 comments
Assignees
Labels
C:patchlang Component: PatchLang I:CHESS Integration with CHESS

Comments

@woodruffw
Copy link
Member

Right now, subclasses of Expression and Statement hardcode their abstract syntax features in the view and concretize methods. To avoid duplication and to make addition of new subclasses easier, these should be lifted to a _template (or similar) class attribute that contains a Handlebar (or other) template.

For example:

class IfStmt(Statement):
    _template = """
    if ({{ cond }}) {
      {{ expr }}
    }
    """

view and concretize could then use _template as appropriate.

@woodruffw woodruffw added the C:patchlang Component: PatchLang label Sep 8, 2020
@woodruffw woodruffw added the I:CHESS Integration with CHESS label Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C:patchlang Component: PatchLang I:CHESS Integration with CHESS
Projects
None yet
Development

No branches or pull requests

2 participants