mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
format: fix vet errors with generated function
This commit is contained in:
parent
b30eaaae44
commit
32bc9e3a50
@ -17,7 +17,7 @@ const isnumber_error int = -1
|
||||
const isnumber_en_main int = 0
|
||||
|
||||
//line isnumber.rl:27
|
||||
func IsNumber(data string) bool {
|
||||
func IsNumber(data string) (isNumber bool) {
|
||||
cs, p, pe := 0, 0, len(data)
|
||||
eof := len(data)
|
||||
ts, te, act := 0, 0, 0
|
||||
@ -25,7 +25,7 @@ func IsNumber(data string) bool {
|
||||
_ = act
|
||||
_ = ts
|
||||
|
||||
//line isnumber.go:37
|
||||
//line isnumber.go:38
|
||||
{
|
||||
cs = isnumber_start
|
||||
ts = 0
|
||||
@ -33,7 +33,7 @@ func IsNumber(data string) bool {
|
||||
act = 0
|
||||
}
|
||||
|
||||
//line isnumber.go:45
|
||||
//line isnumber.go:46
|
||||
{
|
||||
if p == pe {
|
||||
goto _test_eof
|
||||
@ -62,7 +62,7 @@ func IsNumber(data string) bool {
|
||||
te = p
|
||||
p--
|
||||
{
|
||||
return false
|
||||
isNumber = false
|
||||
}
|
||||
goto st0
|
||||
tr4:
|
||||
@ -70,7 +70,7 @@ func IsNumber(data string) bool {
|
||||
te = p
|
||||
p--
|
||||
{
|
||||
return te == len(data)
|
||||
isNumber = te == len(data)
|
||||
}
|
||||
goto st0
|
||||
tr7:
|
||||
@ -78,7 +78,7 @@ func IsNumber(data string) bool {
|
||||
te = p
|
||||
p--
|
||||
{
|
||||
return te == len(data)
|
||||
isNumber = te == len(data)
|
||||
}
|
||||
goto st0
|
||||
tr10:
|
||||
@ -87,12 +87,12 @@ func IsNumber(data string) bool {
|
||||
case 2:
|
||||
{
|
||||
p = (te) - 1
|
||||
return te == len(data)
|
||||
isNumber = te == len(data)
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
p = (te) - 1
|
||||
return false
|
||||
isNumber = false
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ func IsNumber(data string) bool {
|
||||
//line NONE:1
|
||||
ts = p
|
||||
|
||||
//line isnumber.go:110
|
||||
//line isnumber.go:111
|
||||
switch data[p] {
|
||||
case 43:
|
||||
goto st2
|
||||
@ -198,7 +198,7 @@ func IsNumber(data string) bool {
|
||||
goto _test_eof7
|
||||
}
|
||||
st_case_7:
|
||||
//line isnumber.go:200
|
||||
//line isnumber.go:201
|
||||
if 48 <= data[p] && data[p] <= 57 {
|
||||
goto tr11
|
||||
}
|
||||
@ -253,9 +253,9 @@ func IsNumber(data string) bool {
|
||||
|
||||
}
|
||||
|
||||
//line isnumber.rl:39
|
||||
//line isnumber.rl:40
|
||||
if cs == format_error {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
return
|
||||
}
|
||||
|
@ -20,12 +20,12 @@ import (
|
||||
float = sign? [0-9]+ '.' [0-9]+ ('E' sign [0-9]+)?;
|
||||
|
||||
main := |*
|
||||
integer => { return te == len(data); };
|
||||
float => { return te == len(data); };
|
||||
any* => { return false; };
|
||||
integer => { isNumber = te == len(data); };
|
||||
float => { isNumber = te == len(data); };
|
||||
any* => { isNumber = false; };
|
||||
*|;
|
||||
}%%
|
||||
func IsNumber(data string) bool {
|
||||
func IsNumber(data string) (isNumber bool) {
|
||||
cs, p, pe := 0, 0, len(data)
|
||||
eof := len(data)
|
||||
ts, te,act := 0,0,0
|
||||
@ -33,6 +33,7 @@ func IsNumber(data string) bool {
|
||||
_ = act
|
||||
_ = ts
|
||||
|
||||
|
||||
%%{
|
||||
write init;
|
||||
write exec;
|
||||
@ -40,5 +41,5 @@ func IsNumber(data string) bool {
|
||||
if cs == format_error {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user