Since parse(val::AbstractString) is really for parsing *expressions*, this 
does seem correct behavior, although a bit surprising.

However, after investigating this, I think parse is not correctly 
documented. The documentation states that:

> *help?> *
> *parse*search: *parse* *parse*ip *parse*int *parse*float *Parse*Error s
> *parse* s*parse*vec
>   parse(str, start; greedy=true, raise=true)
>   Parse the expression string and return an expression (which could later 
> be
>   passed to eval for execution). start is the index of the first 
> character to
>   start parsing. If greedy is true (default), parse will try to consume as
>   much input as it can; otherwise, it will stop as soon as it has parsed a
>   valid expression. Incomplete but otherwise syntactically valid 
> expressions
>   will return Expr(:incomplete, "(error message)"). If raise is true
>   (default), syntax errors other than incomplete expressions will raise an
>   error. If raise is false, parse will return an expression that will 
> raise an
>   error upon evaluation.


However, this form does not return an expression, it always returns a 
tuple, with the expression as the first part, and the position in the 
string where it stopped parsing as the second part.


Reply via email to