diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-30 18:56:23 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-30 19:38:10 +0200 |
| commit | 9b6eb662150adbcd5ffe293a8719ffc4d7c14996 (patch) | |
| tree | a47bcdcab27e91b4fa5b368add1256127943df3f /mardown/ast.go | |
| parent | baccf109b9d7eb7e95f084579eaea7b6d88b782b (diff) | |
feat(markdown): set eval return type
Diffstat (limited to 'mardown/ast.go')
| -rw-r--r-- | mardown/ast.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mardown/ast.go b/mardown/ast.go index 819d73a..fb78113 100644 --- a/mardown/ast.go +++ b/mardown/ast.go @@ -3,20 +3,21 @@ package mardown import ( "errors" "fmt" + "html/template" ) var ErrUnkownLexType = errors.New("unkown lex type") type block interface { - Eval() error + Eval() (template.HTML, error) } type tree struct { blocks []block } -func (t *tree) Eval() error { - return nil +func (t *tree) Eval() (template.HTML, error) { + return "", nil } func ast(lxs lexers) (*tree, error) { @@ -42,7 +43,8 @@ func getBlock(lxs lexers) (block, error) { case lexerCode: case lexerEscape: case lexerQuote: - case lexerLiteral, lexerBreak: + case lexerBreak: + case lexerLiteral: b = astLiteral(lxs.Current().Value) default: err = errors.Join(ErrUnkownLexType, fmt.Errorf("type received: %s", lxs.Current().Type)) |
