Re: Rosetta code: help needed
- Posted by petelomax Oct 28, 2016
- 1692 views
ed_davis said...
Where? Which task, and which solution?
The lexical analyser, test case 3, Euphoria, C, and Python.
The problem is with
if next_ch() = '*' and next_ch() = '/' then
I solved it (for Euphoria/Phix) with
-- comment found the_ch = next_ch() while true do --DEV I suspect this will break on "**/": [YEP, IT DOES] -- if next_ch() = '*' and next_ch() = '/' then if the_ch = '*' then if next_ch() = '/' then the_ch = next_ch() return get_tok() end if elsif the_ch = EOF then error("%d %d EOF in comment", {tok_line, tok_col}) else the_ch = next_ch() end if end while