0xfaded / eval

BSD 3-Clause "New" or "Revised" License
34 stars 7 forks source link

[r=Rocky]Implemented ast.IndexExpr a[0]; maps unimplemented #6

Closed 0xfaded closed 10 years ago

0xfaded commented 10 years ago

http://golang.org/ref/spec#Index_expressions

known issues.

Constant indicies should fail if expression does not eval to int. e.g. a[2_0.5] is valid according to spec, whilst a[2_0.4] is not. Current implementation simply casts untyped floats to an int.

No bounds checks on constant strings. e.g. "abc"[4] should produce an error (not panic)

rocky commented 10 years ago

Many thanks!