Skip to content
Snippets Groups Projects
Commit 5f4d0d8d authored by Mateusz Goślinowski's avatar Mateusz Goślinowski Committed by Cheng Shao
Browse files

Allow multiline strings in JS FFI (#25633)

(cherry picked from commit 14f8a7ec)
parent 7d362e8e
No related branches found
No related tags found
No related merge requests found
...@@ -2148,6 +2148,9 @@ fspec :: { Located (TokDcolon ...@@ -2148,6 +2148,9 @@ fspec :: { Located (TokDcolon
: STRING var '::' sigtype { sLL $1 $> (epUniTok $3 : STRING var '::' sigtype { sLL $1 $> (epUniTok $3
,(L (getLoc $1) ,(L (getLoc $1)
(getStringLiteral $1), $2, $4)) } (getStringLiteral $1), $2, $4)) }
| STRING_MULTI var '::' sigtype { sLL $1 $> (epUniTok $3
,(L (getLoc $1)
(getStringMultiLiteral $1), $2, $4)) }
| var '::' sigtype { sLL $1 $> (epUniTok $2 | var '::' sigtype { sLL $1 $> (epUniTok $2
,(noLoc (StringLiteral NoSourceText nilFS Nothing), $1, $3)) } ,(noLoc (StringLiteral NoSourceText nilFS Nothing), $1, $3)) }
-- if the entity string is missing, it defaults to the empty string; -- if the entity string is missing, it defaults to the empty string;
...@@ -4247,6 +4250,7 @@ getINCOHERENT_PRAGs (L _ (ITincoherent_prag src)) = src ...@@ -4247,6 +4250,7 @@ getINCOHERENT_PRAGs (L _ (ITincoherent_prag src)) = src
getCTYPEs (L _ (ITctype src)) = src getCTYPEs (L _ (ITctype src)) = src
getStringLiteral l = StringLiteral (getSTRINGs l) (getSTRING l) Nothing getStringLiteral l = StringLiteral (getSTRINGs l) (getSTRING l) Nothing
getStringMultiLiteral l = StringLiteral (getSTRINGMULTIs l) (getSTRINGMULTI l) Nothing
isUnicode :: Located Token -> Bool isUnicode :: Located Token -> Bool
isUnicode (L _ (ITforall iu)) = iu == UnicodeSyntax isUnicode (L _ (ITforall iu)) = iu == UnicodeSyntax
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment