on master help sign in
fix restriction predicate lacking whitespace after quotedString

-add test to cover this case

commit2af3d66347171d5674fa5cc0aebf2ff5f8cd0e8c authorAgentM <agentm@themactionfaction.com> dateFri 2 Oct 2015, 12:53 (11 years ago) parentf07d7cd
2 files changed+2−1
TutorialD/Interpreter/Base.hs+1−1 test/TutorialD/Interpreter.hs+1
TutorialD/Interpreter/Base.hs+1−1
@@ -88,5 +88,5 @@ quotedChar = noneOf "\""
8888 <|> try (string "\"\"" >> return '"')
8989
9090quotedString :: Parser String
91−quotedString = string "\"" *> many quotedChar <* string "\""
91+quotedString = string "\"" *> many quotedChar <* string "\"" <* whiteSpace
9292
test/TutorialD/Interpreter.hs+1
@@ -66,6 +66,7 @@ main = do
6666 dateExampleRelTests = [("x:=S where true", Right suppliersRel),
6767 ("x:=S where CITY = \"London\"", restrict (\tuple -> atomForAttributeName "CITY" tuple == (Right $ StringAtom "London")) suppliersRel),
6868 ("x:=S where false", Right $ Relation (attributes suppliersRel) emptyTupleSet),
69+ ("x:=P where COLOR=\"Blue\" and CITY=\"Paris\"", mkRelationFromList (attributes productsRel) [[StringAtom "P5", StringAtom "Cam", StringAtom "Blue", IntAtom 12, StringAtom "Paris"]]),
6970 ("a:=S; update a (STATUS:=50); x:=a{STATUS}", mkRelation (A.attributesFromList [ Attribute "STATUS" IntAtomType]) (RelationTupleSet [mkRelationTuple (A.attributesFromList [Attribute "STATUS" IntAtomType]) (V.fromList [IntAtom 50])])),
7071 --atom function tests
7172 ("x:=((S : {STATUS2 := add(10,@STATUS)}) where STATUS2=add(10,@STATUS)){CITY,S#,SNAME,STATUS}", Right suppliersRel),