fix finish number error
This commit is contained in:
@ -22,7 +22,7 @@ func (e *Encoder) WriteSNBT(snbt string) error {
|
||||
panic(phasePanicMsg)
|
||||
|
||||
case scanBeginLiteral:
|
||||
|
||||
return writeLiteral(e, &d)
|
||||
case scanBeginCompound:
|
||||
panic("not implemented")
|
||||
|
||||
|
@ -86,7 +86,7 @@ func (s *scanner) popParseState() {
|
||||
s.parseState = s.parseState[:n]
|
||||
if n == 0 {
|
||||
s.step = s.stateEndTop
|
||||
//s.endTop = true
|
||||
s.endTop = true
|
||||
} else {
|
||||
s.step = s.stateEndValue
|
||||
}
|
||||
@ -324,10 +324,6 @@ func (s *scanner) stateNumDot0(c byte) int {
|
||||
}
|
||||
|
||||
func (s *scanner) stateEndNumValue(c byte) int {
|
||||
if isSpace(c) {
|
||||
s.step = s.stateEndValue
|
||||
return scanSkipSpace
|
||||
}
|
||||
switch c {
|
||||
case 'b', 'B': // TAG_Byte
|
||||
s.step = s.stateEndValue
|
||||
|
@ -6,12 +6,13 @@ import (
|
||||
)
|
||||
|
||||
func TestSNBT_checkScanCode(t *testing.T) {
|
||||
t.SkipNow()
|
||||
//t.SkipNow()
|
||||
var s scanner
|
||||
s.reset()
|
||||
for _, c := range []byte(`{ "a b\"c": {}, def: 12345}`) {
|
||||
for _, c := range []byte(`1234`) {
|
||||
t.Logf("[%c] - %d", c, s.step(c))
|
||||
}
|
||||
t.Logf("[%c] - %d", ' ', s.eof())
|
||||
}
|
||||
|
||||
func TestSNBT_number(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user