func stComment(l lex.Lexer) lex.StateFn { isComment := '-' == l.NextRune() && '-' == l.NextRune() if !isComment { emitError("Comment parser called without comment.") return nil } // check if this is going to be a block comment if longStringEquals('[', l) >= 0 { // consume the string portion if !readLongString(l) { emitError("Error reading block-comment contents") return nil } } else { // read til \n is found l.NonMatchZeroOrMoreRunes([]rune{'\n', lex.RuneEOF}) } emit(l, Comment) return stStart }