Add basic compiler, parser, and main program + GNU LGPL
This commit is contained in:
parent
863498439a
commit
0a0b3745d0
4 changed files with 154 additions and 0 deletions
19
compiler/compiler.go
Normal file
19
compiler/compiler.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue