Add basic compiler, parser, and main program + GNU LGPL

This commit is contained in:
conzer 2024-12-05 18:29:52 -05:00
parent 863498439a
commit 0a0b3745d0
4 changed files with 154 additions and 0 deletions

19
compiler/compiler.go Normal file
View file

@ -0,0 +1,19 @@
package compiler
import (
"strings"
)
// THE HYLIA COMPILER
func Compile(elements []string) (string, error) {
html := "<!DOCTYPE html>\n<html>\n<body>\n"
// Take the elements into HTML
for _, element := range elements {
html += element + "\n"
}
html += "</body>\n</html>"
return html, nil
}