1. Ambiguous documentation
- Posted by axtens_bruce in March
- 391 views
Please explain what the Comments section means. I just don't get it.
8.50.7.3 show_tokens include euphoria/tokenize.e namespace tokenize public procedure show_tokens(integer fh, sequence tokens) Print token names and data for each token in `tokens` to the file handle `fh` Parameters: fh - file handle to print information to tokens - token sequence to print Comments: This does not take direct output from tokenize_string or tokenize_file. Instead they take the first element of their return value, the token stream only.-Bruce
2. Re: Ambiguous documentation
- Posted by petelomax in March
- 380 views
If you look at tokenize_string() at line 1154 in https://github.com/OpenEuphoria/euphoria/blob/master/include/euphoria/tokenize.e ,
it returns { tokens, ERR, ERR_LNUM, ERR_LPOS }. So that comment just means you should not pass the whole result from that, but res[1].
Perhaps a better way to word that might be:
Note that tokenize_string() and tokenize_file() return { tokens, ERR, ERR_LNUM, ERR_LPOS } and this routine only wants the res[1] from that.
3. Re: Ambiguous documentation
- Posted by SDPringle in March
- 348 views
The use of the term "res[1]", is what I would object to. People will look at that and wonder who res is.
4. Re: Ambiguous documentation
- Posted by ghaberek (admin) in March
- 347 views
On Euphoria 4.1 and later, you can use multiple assignment to split out all four values at once:
object tokens, err, lnum lpos {tokens,err,lnum,lpos} = tokenize_string( ... )
-Greg
5. Re: Ambiguous documentation
- Posted by petelomax in March
- 349 views
The use of the term "res[1]", is what I would object to. People will look at that and wonder who res is.
Fair enough, replace it with "first element"