Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 2fee571c8ff7f751b8ffd67176c1660f > files > 115

re2c-2.0.3-1.mga7.armv7hl.rpm

// Code generated by re2c, DO NOT EDIT.
//go:generate re2go -c $INPUT -o $OUTPUT -i
package main

import "testing"
const (
	ResultOk = iota
	ResultFail
)




func lex(str string) int {
	var cursor int
	
{
	var yych byte
	yych = str[cursor]
	switch (yych) {
	case '1':
		fallthrough
	case '2':
		fallthrough
	case '3':
		fallthrough
	case '4':
		fallthrough
	case '5':
		fallthrough
	case '6':
		fallthrough
	case '7':
		fallthrough
	case '8':
		fallthrough
	case '9':
		goto yy4
	default:
		goto yy2
	}
yy2:
	cursor += 1
	{ return ResultFail }
yy4:
	cursor += 1
	yych = str[cursor]
	switch (yych) {
	case '0':
		fallthrough
	case '1':
		fallthrough
	case '2':
		fallthrough
	case '3':
		fallthrough
	case '4':
		fallthrough
	case '5':
		fallthrough
	case '6':
		fallthrough
	case '7':
		fallthrough
	case '8':
		fallthrough
	case '9':
		goto yy4
	default:
		goto yy6
	}
yy6:
	{ return ResultOk }
}

}

func TestLex(t *testing.T) {
	if lex("123\000") != ResultOk {
		t.Errorf("error")
	}
}