on master help sign in
just put information about multiline strings inline
commit2f05e37abd3a2c2b1c995b79544d1168156e80e2 authorEvan Czaplicki <evancz@users.noreply.github.com> dateThu 27 Jun 2019, 16:46 (7 years ago) parentf57012c
1 file changed+29−2
compiler/src/Reporting/Error/Syntax.hs+29−2
compiler/src/Reporting/Error/Syntax.hs+29−2
@@ -2408,7 +2408,21 @@ toStringReport source string row col =
24082408 ,"quotes","on","each","end.","Is","the","closing","double"
24092409 ,"quote","missing","in","your","code?"
24102410 ]
2411− , D.link "Note" "Read" "TODO" "if you want a string that spans multiple lines."
2411+ , D.toSimpleNote $
2412+ "For a string that spans multiple lines, you can use the multi-line string\
2413+ \ syntax like this:"
2414+ , D.vcat
2415+ [ D.fillSep [D.green "markdown","=",D.dullyellow "\"\"\""]
2416+ , mempty
2417+ , D.dullyellow "# Multi-line Strings"
2418+ , mempty
2419+ , D.dullyellow "- start with triple double quotes"
2420+ , D.dullyellow "- write whatever you want"
2421+ , D.dullyellow "- no need to escape newlines or double quotes"
2422+ , D.dullyellow "- end with triple double quotes"
2423+ , mempty
2424+ , D.dullyellow "\"\"\""
2425+ ]
24122426 ]
24132427 )
24142428
@@ -2424,7 +2438,20 @@ toStringReport source string row col =
24242438 ,
24252439 D.stack
24262440 [ D.reflow "Add a \"\"\" somewhere after this to end the string."
2427− , D.link "Hint" "Read" "TODO" "for more information on strings and multi-line strings."
2441+ , D.toSimpleNote $
2442+ "Here is a valid multi-line string for reference:"
2443+ , D.vcat
2444+ [ D.fillSep [D.green "markdown","=",D.dullyellow "\"\"\""]
2445+ , mempty
2446+ , D.dullyellow "# Multi-line Strings"
2447+ , mempty
2448+ , D.dullyellow "- start with triple double quotes"
2449+ , D.dullyellow "- write whatever you want"
2450+ , D.dullyellow "- no need to escape newlines or double quotes"
2451+ , D.dullyellow "- end with triple double quotes"
2452+ , mempty
2453+ , D.dullyellow "\"\"\""
2454+ ]
24282455 ]
24292456 )
24302457