File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
persistent/Database/Persist/Quasi/Internal Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,7 @@ data Attribute
274274data DirectiveArgument
275275 = -- This is too unstructured. We should rework directive parsing and make this smarter.
276276 DText Text
277+ | DParenthetical Text
277278 | -- | Quoted directive arguments are deprecated since 2.17.1.0.
278279 DQuotation Text
279280 deriving (Eq , Ord , Show )
@@ -860,13 +861,16 @@ directiveArgument = do
860861 where
861862 isQuotedArgumentError (FancyError _ s) = s == Set. singleton (ErrorFail quotedArgumentErrorMessage)
862863 isQuotedArgumentError _ = False
864+ parentheticalInner = do
865+ str <- parenthetical'
866+ pure . init . drop 1 $ str
863867 directiveArgument' = do
864868 q <- lookAhead (optional $ char ' "' )
865869 case q of
866870 Just _ -> fail quotedArgumentErrorMessage
867871 Nothing ->
868872 choice
869- [ DText . Text. pack <$> parenthetical'
873+ [ DParenthetical . Text. pack . init . drop 1 <$> L. lexeme spaceConsumer parenthetical'
870874 , DText . Text. pack <$> some directiveArgumentChar
871875 ]
872876 -- This big random-looking character class is a sign that the parser is too lax.
@@ -904,6 +908,7 @@ directiveArgument = do
904908directiveArgumentContent :: DirectiveArgument -> Text
905909directiveArgumentContent = \ case
906910 DText t -> t
911+ DParenthetical t -> t
907912 DQuotation t -> t
908913
909914directive :: Parser Member
You can’t perform that action at this time.
0 commit comments