merge DocComment and PlainComment

This commit is contained in:
z7zmey
2018-04-15 15:55:33 +03:00
parent e65ace8984
commit c2f938e55c
13 changed files with 62 additions and 92 deletions

View File

@@ -438,7 +438,7 @@ type Lexer struct {
*lex.Lexer
StateStack []int
PhpDocComment string
Comments []comment.Comment
Comments []*comment.Comment
}
// Rune2Class returns the rune integer id
@@ -520,7 +520,8 @@ func (l *Lexer) newToken(chars []lex.Char) Token {
return NewToken(l.charsToBytes(chars), startLine, endLine, startPos, endPos).SetComments(l.Comments)
}
func (l *Lexer) addComment(c comment.Comment) {
func (l *Lexer) addComment(chars []lex.Char) {
c := comment.NewComment(string(l.charsToBytes(chars)))
l.Comments = append(l.Comments, c)
}