DE-labtory / koa

The koa is a high-level language that has more expressions than the bitcoin script and is simpler and easy to analyze
Apache License 2.0
74 stars 18 forks source link

[parser] check symbol table when parsing function parameters #258

Closed zeroFruit closed 5 years ago

zeroFruit commented 5 years ago

Detail

func parseFunctionParameter(buf TokenBuffer) (*ast.ParameterLiteral, error) {
    token := buf.Read()
    if token.Type != Ident {
        return nil, ExpectError{
            token,
            Ident,
        }
    }

    // TODO: check whether variable name exist,
    // TODO: but do not update symbol table in this case
    // TODO: if not, return error
boohyunsik commented 5 years ago

@zeroFruit Hmm... I think we should modify parseCallArgument() function..

zeroFruit commented 5 years ago

no arguments are check from parseIdentifier

for example in

foo(a, b)

a, b is checked from parseIdentifier

boohyunsik commented 5 years ago

Ah, Ok!