1
0

ignore commented headings

This commit is contained in:
2021-08-25 10:15:18 +02:00
parent caea5f7c25
commit 847fdebd42
2 changed files with 10 additions and 4 deletions

11
main.go
View File

@ -41,14 +41,17 @@ func main() {
lexer := Lexer{}
scanner := bufio.NewScanner(data)
for scanner.Scan() {
counter++
// skip the first heading
scanner.Scan()
// skip the first heading
if counter == 1 {
for scanner.Scan() {
// skip commented headings
if scanner.Text()[3:10] == "COMMENT" {
continue
}
counter++
tokens := lexer.Process(scanner.Text())
feed := Parse(tokens).String()
file.WriteString(feed + "\n")