on master help sign in
allow negative numbers in tutd

resolves #202

commitc3a4e2d21fdad58cea8996978f3fbb50056c2760 authorAgentM <agentm@themactionfaction.com> dateWed 23 May 2018, 18:31 (8 years ago) parent015506f
2 files changed+2−2
src/bin/TutorialD/Interpreter/Base.hs+1−1 test/TutorialD/Interpreter.hs+1−1
src/bin/TutorialD/Interpreter/Base.hs+1−1
@@ -94,7 +94,7 @@ whiteSpace = Token.whiteSpace lexer
9494-}
9595
9696integer :: Parser Integer
97−integer = Lex.integer
97+integer = Lex.signed spaceConsumer Lex.integer
9898
9999float :: Parser Double
100100float = Lex.float
test/TutorialD/Interpreter.hs+1−1
@@ -86,7 +86,7 @@ main = do
8686 ("x:=true=true", Right relationTrue),
8787 ("x:=true=false", Right relationFalse),
8888 ("x:=true; undefine x", Left (RelVarNotDefinedError "x")),
89− ("x:=relation {b Integer, a Text}{}; insert x relation{tuple{b 5, a \"spam\"}}", mkRelationFromTuples simpleCAttributes [RelationTuple simpleCAttributes $ V.fromList [TextAtom "spam", IntegerAtom 5]]),
89+ ("x:=relation {b Integer, a Text}{}; insert x relation{tuple{b -5, a \"spam\"}}", mkRelationFromTuples simpleCAttributes [RelationTuple simpleCAttributes $ V.fromList [TextAtom "spam", IntegerAtom (-5)]]),
9090 -- test nested relation constructor
9191 ("x:=relation{tuple{a 5, b relation{tuple{a 6}}}}", mkRelation nestedRelationAttributes $ RelationTupleSet [RelationTuple nestedRelationAttributes (V.fromList [IntegerAtom 5, RelationAtom (Relation simpleAAttributes $ RelationTupleSet [RelationTuple simpleAAttributes $ V.fromList [IntegerAtom 6]])])]),
9292 ("x:=relation{tuple{b 5,a \"spam\"},tuple{b 6,a \"sam\"}}; delete x where b=6", mkRelation simpleCAttributes $ RelationTupleSet [RelationTuple simpleCAttributes (V.fromList [TextAtom "spam", IntegerAtom 5])]),