Skip to content

Commit 55e3adf

Browse files
committed
Parser: Use Injection instances
1 parent f48f4fb commit 55e3adf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kore/src/Kore/Parser/Parser.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ parseSentence =
613613
parseSentenceSymbol :: Parser ParsedSentence
614614
parseSentenceSymbol = do
615615
keyword "symbol"
616-
SentenceSymbolSentence <$> parseSentenceSymbolRemainder
616+
inject <$> parseSentenceSymbolRemainder
617617

618618
{- | Parse a hooked symbol declaration.
619619
@@ -627,7 +627,7 @@ parseSentenceSymbol = do
627627
parseSentenceHookedSymbol :: Parser ParsedSentence
628628
parseSentenceHookedSymbol = do
629629
keyword "hooked-symbol"
630-
SentenceHookSentence . SentenceHookedSymbol
630+
inject . SentenceHookedSymbol
631631
<$> parseSentenceSymbolRemainder
632632

633633
{- | Parse a @symbol@ or @hooked-symbol@ sentence after the initial keyword.
@@ -677,7 +677,7 @@ parseSentenceAlias = do
677677
keyword ":="
678678
sentenceAliasRightPattern <- parsePattern
679679
sentenceAliasAttributes <- parseAttributes
680-
(pure . SentenceAliasSentence) SentenceAlias
680+
(pure . inject) SentenceAlias
681681
{ sentenceAliasAlias
682682
, sentenceAliasSorts
683683
, sentenceAliasResultSort
@@ -717,7 +717,7 @@ parseSentenceImport = do
717717
parseSentenceAxiom :: Parser ParsedSentence
718718
parseSentenceAxiom = do
719719
keyword "axiom"
720-
SentenceAxiomSentence <$> parseSentenceAxiomRemainder
720+
inject <$> parseSentenceAxiomRemainder
721721

722722
{- | Parse an claim sentence.
723723
@@ -732,7 +732,7 @@ parseSentenceAxiom = do
732732
parseSentenceClaim :: Parser ParsedSentence
733733
parseSentenceClaim = do
734734
keyword "claim"
735-
SentenceClaimSentence . SentenceClaim <$> parseSentenceAxiomRemainder
735+
inject . SentenceClaim <$> parseSentenceAxiomRemainder
736736

737737
{- | Parses the part of @axiom@ or @claim@ after its introductory
738738
keyword using the given constructor to construct the appropriate object.
@@ -764,7 +764,7 @@ parseSentenceAxiomRemainder = do
764764
parseSentenceSort :: Parser ParsedSentence
765765
parseSentenceSort = do
766766
keyword "sort"
767-
SentenceSortSentence <$> parseSentenceSortRemainder
767+
inject <$> parseSentenceSortRemainder
768768

769769
{- | Parse a hooked sort sentence.
770770
@@ -777,7 +777,7 @@ parseSentenceSort = do
777777
parseSentenceHookedSort :: Parser ParsedSentence
778778
parseSentenceHookedSort = do
779779
keyword "hooked-sort"
780-
SentenceHookSentence . SentenceHookedSort <$> parseSentenceSortRemainder
780+
inject . SentenceHookedSort <$> parseSentenceSortRemainder
781781

782782
{- | Parse the part of @sort@ or @hooked-sort@ after the initial keyword.
783783

0 commit comments

Comments
 (0)