on master help sign in
just put information about multiline strings inline
2f05e37Evan Czaplicki
compiler/src/Reporting/Error/Syntax.hs+29−2
@@ -2408,7 +2408,21 @@ toStringReport source string row col =
2408 ,"quotes","on","each","end.","Is","the","closing","double"
2408 ,"quotes","on","each","end.","Is","the","closing","double"
2409 ,"quote","missing","in","your","code?"
2409 ,"quote","missing","in","your","code?"
2410 ]
2410 ]
2411+ , D.toSimpleNote $
2411− , D.link "Note" "Read" "TODO" "if you want a string that spans multiple lines."
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+ ]
2412 ]
2426 ]
2413 )
2427 )
2414
2428
@@ -2424,7 +2438,20 @@ toStringReport source string row col =
2424 ,
2438 ,
2425 D.stack
2439 D.stack
2426 [ D.reflow "Add a \"\"\" somewhere after this to end the string."
2440 [ 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+ ]
2428 ]
2455 ]
2429 )
2456 )
2430
2457