Verified Commit 690786b6 authored by Camil Staps's avatar Camil Staps 🙂

Fix comment scanner in Clean.Parse.Comments for //* occurring inside a multiline comment

parent f011f7d1
Pipeline #43494 passed with stage
in 2 minutes and 19 seconds
......@@ -129,7 +129,9 @@ scan ss=:{idx}
| otherwise = case [ss.input.[i] \\ i <- [idx..]] of
[s:_] | s=='\r' || s=='\n' || s=='\t'
-> scan (advance ss)
['//':_] | ss.comment_level == 0
['//':_]
| ss.comment_level <> 0
-> scan (scan_to_newline ss)
# cmnt =
{ line = ss.ln
, column = ss.col
......
......@@ -3,6 +3,8 @@ definition module commentstest
/**
* This module is used to test the Clean documentation parser in Clean.Parse.Comments.
* The documentation here is written obscurely on purpose!
*
* //* this may trip the parser up
*/
import syntax
......
......@@ -31,7 +31,7 @@ Start w
expected :: [Entry]
expected =
[ {kind="module", name="commentstest", value=Just "*\n * This module is used to test the Clean documentation parser in Clean.Parse.Comments.\n * The documentation here is written obscurely on purpose!\n "}
[ {kind="module", name="commentstest", value=Just "*\n * This module is used to test the Clean documentation parser in Clean.Parse.Comments.\n * The documentation here is written obscurely on purpose!\n *\n * //* this may trip the parser up\n "}
, {kind="type", name="Entry", value=Just "* A documentation entry\n"}
, {kind="selector", name="kind", value=Just "* the kind of thing that is documented\n"}
, {kind="selector", name="name", value=Just "* the name of the documented thing\n"}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment