Konstantin8105 / c4go

Transpiling C code to Go code
MIT License
363 stars 37 forks source link

simplificaition for Go result #402

Closed Konstantin8105 closed 5 years ago

Konstantin8105 commented 5 years ago
    (func() []byte {
        defer func() {
            func() []byte {
                tempVarUnary := s
                defer func() {
                    s = s[0+1:]
                }()
                return tempVarUnary
            }()
        }()
        return s
    }())[0] = byte(c)
Konstantin8105 commented 5 years ago
// tok_type - transpiled function from  C4GO/testdata/neateqn/tok.c:421
func tok_type() int32 {
    // current token type
    return func() int32 {
        if int32(tok[0]) != 0 {
            return tok_curtype
        }
        return 0
    }()
}