api support for comment double slash // (#201)

* add comment support

* add comment support

Co-authored-by: kim <xutao@xiaoheiban.cn>
This commit is contained in:
kingxt
2020-11-12 16:57:28 +08:00
committed by GitHub
parent e6df21e0d2
commit 7b4a5e3ec6
5 changed files with 79 additions and 12 deletions

View File

@@ -30,7 +30,7 @@ func newEntity(state *baseState, api *spec.ApiSpec, parser entityParser) entity
}
func (s *entity) process() error {
line, err := s.state.readLine()
line, err := s.state.readLineSkipComment()
if err != nil {
return err
}
@@ -59,7 +59,7 @@ func (s *entity) process() error {
var annos []spec.Annotation
memberLoop:
for {
ch, err := s.state.read()
ch, err := s.state.readSkipComment()
if err != nil {
return err
}
@@ -70,7 +70,7 @@ memberLoop:
case ch == at:
annotationLoop:
for {
next, err := s.state.read()
next, err := s.state.readSkipComment()
if err != nil {
return err
}
@@ -127,7 +127,7 @@ memberLoop:
}
var line string
line, err = s.state.readLine()
line, err = s.state.readLineSkipComment()
if err != nil {
return err
}