Skip to content

Commit

Permalink
Merge pull request #1599 from spechub/1598_error_when_parsing_filtering
Browse files Browse the repository at this point in the history
added 'extract' and 'remove' as keywords
  • Loading branch information
tillmo committed Mar 15, 2016
2 parents c3bb3ac + a8f68a4 commit 996ed46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Common/Keywords.hs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ etypeS = "etype"
existsS :: String
existsS = "exists"

extractS :: String
extractS = "extract"

falseS :: String
falseS = "false"

Expand Down Expand Up @@ -565,6 +568,9 @@ refinementS = "refinement"
rejectS :: String
rejectS = "reject"

removeS :: String
removeS = "remove"

resultS :: String
resultS = "result"

Expand Down
4 changes: 2 additions & 2 deletions Common/Token.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ criticalKeywords = terminatingKeywords ++ startingKeywords
-- | keywords terminating a basic spec
terminatingKeywords :: [String]
terminatingKeywords =
[ andS, endS, fitS, forgetS, hideS, keepS, rejectS, revealS, selectS
, thenS, withS, withinS, ofS, forS, toS, intersectS]
[ andS, endS, extractS, fitS, forgetS, hideS, keepS, rejectS, removeS,
revealS, selectS, thenS, withS, withinS, ofS, forS, toS, intersectS]

-- | keywords starting a library item
startingKeywords :: [String]
Expand Down
4 changes: 2 additions & 2 deletions Syntax/Parse_AS_Structured.hs
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ minimization lg = do

extraction :: LogicGraph -> AParser st EXTRACTION
extraction lg = do
p <- asKey "extract" <|> asKey "remove"
p <- asKey extractS <|> asKey removeS
is <- many1 (hetIRI lg)
return . ExtractOrRemove (tokStr p == "extract") is $ tokPos p
return . ExtractOrRemove (tokStr p == extractS) is $ tokPos p

filtering :: LogicGraph -> AParser st FILTERING
filtering lg = do
Expand Down

0 comments on commit 996ed46

Please sign in to comment.