git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Blockstring
ad2988dOleg Grenrus
examples/passing/BlockString.pursnew file+12
@@ -0,0 +1,12 @@
1+module Main where
2+
3+foreign import foo """
4+ function foo(s) {
5+ return s;
6+ }
7+""" :: String -> String
8+
9+bar :: String -> String
10+bar _ = foo "test"
11+
12+main = Debug.Trace.trace "Done"
src/Language/PureScript/Parser/Common.hs+3−1
@@ -155,7 +155,9 @@ operator = PT.operator tokenParser
155-- Parse a string literal
155-- Parse a string literal
156--
156--
157stringLiteral :: P.Parsec String u String
157stringLiteral :: P.Parsec String u String
158−stringLiteral = PT.stringLiteral tokenParser
158+stringLiteral = lexeme blockString <|> PT.stringLiteral tokenParser
159+ where delimeter = P.try (P.string "\"\"\"")
160+ blockString = delimeter >> P.manyTill P.anyChar delimeter
159
161
160-- |
162-- |
161-- Parse whitespace
163-- Parse whitespace