Misc cleanup: SETUP_FILE -> SETUPFILE, empty example lines, ...

This commit is contained in:
Niklas Fasching 2018-12-20 15:39:49 +01:00
parent d1054063cf
commit bc9c496f97
11 changed files with 17 additions and 15 deletions

View file

@ -8,11 +8,11 @@ type Example struct {
Children []Node
}
var exampleLineRegexp = regexp.MustCompile(`^(\s*): (.*)`)
var exampleLineRegexp = regexp.MustCompile(`^(\s*):(\s(.*)|\s*$)`)
func lexExample(line string) (token, bool) {
if m := exampleLineRegexp.FindStringSubmatch(line); m != nil {
return token{"example", len(m[1]), m[2], m}, true
return token{"example", len(m[1]), m[3], m}, true
}
return nilToken, false
}