You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (de *Describle) ParseLi() bool {
var tw []byte
i := 0
tw = de.li[i:i]
for ; i < len(de.li) && de.li[i] == '\t'; i += 1 {
tw = append(tw, de.li[i])
}
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
tw = tw[:0]
jump:
if i < len(de.li) {
switch de.li[i] {
case '"':
goto biquote
case ''':
goto singlequote
case ':':
goto colon
case ';':
goto semicolon
default:
goto other
}
} else {
goto end
}
semicolon:
if len(tw) > 0 {
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
}
i += 1
tw = de.li[i:i]
for ; i < len(de.li) && !(de.li[i] == '"' || de.li[i] == ''' || de.li[i] == ':' || de.li[i] == ';'); i += 1 {
tw = append(tw, de.li[i])
}
goto jump
colon:
if len(tw) > 0 {
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
}
tw = de.li[i:i]
for ; i < len(de.li) && de.li[i] == ':'; i += 1 {
tw = append(tw, de.li[i])
}
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
tw = de.li[i:i]
goto jump
biquote:
bqs := de.li[i]
var bqs1 byte
if i+1 < len(de.li) && de.li[i+1] == '"' {
bqs1 = de.li[i+1]
tw = append(tw, de.li[i])
i += 1
}
tw = append(tw, de.li[i])
i += 1
for ; i < len(de.li); i += 1 {
switch de.li[i] {
case bqs:
if bqs1 == 0 {
tw = append(tw, de.li[i])
i += 1
goto jump
} else {
if i+1 < len(de.li) && de.li[i+1] == '"' {
tw = append(tw, de.li[i])
tw = append(tw, de.li[i+1])
i += 2
goto jump
} else {
tw = append(tw, de.li[i])
}
}
default:
tw = append(tw, de.li[i])
}
}
goto jump
singlequote:
sqs := de.li[i]
var sqs1 byte
if i+1 < len(de.li) && de.li[i+1] == ''' {
sqs1 = de.li[i+1]
tw = append(tw, de.li[i])
i += 1
}
tw = append(tw, de.li[i])
i += 1
for ; i < len(de.li); i += 1 {
switch de.li[i] {
case sqs:
if sqs1 == 0 {
tw = append(tw, de.li[i])
i += 1
goto jump
} else {
if i+1 < len(de.li) && de.li[i+1] == ''' {
tw = append(tw, de.li[i])
tw = append(tw, de.li[i+1])
i += 2
goto jump
} else {
tw = append(tw, de.li[i])
}
}
default:
tw = append(tw, de.li[i])
}
}
goto jump
end:
if le(tw) > 0 {
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
}
de.parsewg.Done()
return false
}
What did you see happen?
.\diskpoda_ai_describle.go:67:9: goto biquote jumps over declaration of ss at .\diskpoda_ai_describle.go:102:5
.\diskpoda_ai_describle.go:69:9: goto singlequote jumps over declaration of bqs1 at .\diskpoda_ai_describle.go:109:6
but ss is in block.it should compile pass theough.
bqs1 is right positionn should compile pass thorough.
What did you expect to see?
compile pass through
The text was updated successfully, but these errors were encountered:
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
What is the URL of the page with the issue?
no
What is your user agent?
no
Screenshot
no
What did you do?
func (de *Describle) ParseLi() bool {
var tw []byte
i := 0
jump:
if i < len(de.li) {
switch de.li[i] {
case '"':
goto biquote
case ''':
goto singlequote
case ':':
goto colon
case ';':
goto semicolon
default:
goto other
}
} else {
goto end
}
semicolon:
if len(tw) > 0 {
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
}
i += 1
tw = de.li[i:i]
for ; i < len(de.li) && !(de.li[i] == '"' || de.li[i] == ''' || de.li[i] == ':' || de.li[i] == ';'); i += 1 {
tw = append(tw, de.li[i])
}
goto jump
colon:
if len(tw) > 0 {
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
}
tw = de.li[i:i]
for ; i < len(de.li) && de.li[i] == ':'; i += 1 {
tw = append(tw, de.li[i])
}
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
tw = de.li[i:i]
goto jump
biquote:
bqs := de.li[i]
var bqs1 byte
if i+1 < len(de.li) && de.li[i+1] == '"' {
bqs1 = de.li[i+1]
tw = append(tw, de.li[i])
i += 1
}
tw = append(tw, de.li[i])
i += 1
for ; i < len(de.li); i += 1 {
switch de.li[i] {
case bqs:
if bqs1 == 0 {
tw = append(tw, de.li[i])
i += 1
goto jump
} else {
if i+1 < len(de.li) && de.li[i+1] == '"' {
tw = append(tw, de.li[i])
tw = append(tw, de.li[i+1])
i += 2
goto jump
} else {
tw = append(tw, de.li[i])
}
}
default:
tw = append(tw, de.li[i])
}
}
goto jump
singlequote:
sqs := de.li[i]
var sqs1 byte
if i+1 < len(de.li) && de.li[i+1] == ''' {
sqs1 = de.li[i+1]
tw = append(tw, de.li[i])
i += 1
}
tw = append(tw, de.li[i])
i += 1
for ; i < len(de.li); i += 1 {
switch de.li[i] {
case sqs:
if sqs1 == 0 {
tw = append(tw, de.li[i])
i += 1
goto jump
} else {
if i+1 < len(de.li) && de.li[i+1] == ''' {
tw = append(tw, de.li[i])
tw = append(tw, de.li[i+1])
i += 2
goto jump
} else {
tw = append(tw, de.li[i])
}
}
default:
tw = append(tw, de.li[i])
}
}
goto jump
other:
for ; i < len(de.li) && !(de.li[i] == '"' || de.li[i] == ''' || de.li[i] == ':' || de.li[i] == ';'); i += 1 {
tw = append(tw, de.li[i])
}
goto jump
end:
if le(tw) > 0 {
ss := NewSimpleSentence(tw)
de.ss = append(de.ss, ss)
}
}
What did you see happen?
.\diskpoda_ai_describle.go:67:9: goto biquote jumps over declaration of ss at .\diskpoda_ai_describle.go:102:5
.\diskpoda_ai_describle.go:69:9: goto singlequote jumps over declaration of bqs1 at .\diskpoda_ai_describle.go:109:6
but ss is in block.it should compile pass theough.
bqs1 is right positionn should compile pass thorough.
What did you expect to see?
compile pass through
The text was updated successfully, but these errors were encountered: