Code Monkey home page Code Monkey logo

axolotl's People

Contributors

ar9v avatar eduardohi avatar kawer avatar

Stargazers

 avatar

Watchers

 avatar  avatar

axolotl's Issues

if the last expression is a sexp, complete program parser fails

-- Infix exp are for now limited to 2 expressions
-- therefore we can not write something like this:
-- (define (append Nil ys) :: {List a -> List a -> List a} ys)
-- (define (append {x : xs} ys)
-- {x : (append ys xs)})


(define (append Nil ys) :: {(List a) -> {(List a) -> (List a)}}
	ys)

define (append {x : xs} ys)
  {x : (append ys xs)}

(infixr ++)
(define ++ append)

example of a failing program

QuickCheck fails on expressions, expsequences, and s-expressions

QuickCheck currently fails with the following failures:

let's debug them.
The bugs can in one of these places:

  • The parser src/Axo/Parser.hs
  • The pretty printer src/Axo/PrettyPrinter.hs
  • The test case generator test/Gen.hs

steps to debug:

  1. copy failure case and pretty print it.
  2. if the output does not look ok, let's check the pretty printer.
  3. if it looks okay, let's run the parser with the input, and see if it crashes.
  4. debug the parser depending on the error that reports (remember to use parseTest <the parser being tested> <the string to test>
  5. if none of this gives more insight, try debugging the generator.
  6. worst case, manually read the ParseTree being generated, looking for a possible error in it (a possible error is an invalid ParseTree`) in that case, we should change the Gen to only generate valid programs.
parsing Expressions
  parsing expression is the inverse of pretty printing it FAILED [1]
  parsing a sequence of expressions is the inverse of pretty printing it FAILED [2]
  parsing s-expression is the inverse of pretty printing it FAILED [3]

Failures:

  test/CheckSpec.hs:51:5: 
  1) parsing Expressions parsing expression is the inverse of pretty printing it
       Falsifiable (after 3 tests):
         ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "W8654"))),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "O59T66o4A"))),Left (EAtom (Id (VarId "npFdZ"))),Left (EAtom (Literal (StringLit "8"))),Left (EAtom (Literal (CharLit '='))),Left (EAtom (Id (TypeId "S")))]))),Left (EAtom (Id (VarId "hUI6Mf545"))),Right (Comment "9"),Left (EAtom (Literal (CharLit 'F')))]))
         Left (ParseErrorBundle {bundleErrors = TrivialError 50 (Just (Tokens ('\'' :| ""))) (fromList [Tokens (')' :| "")]) :| [], bundlePosState = PosState {pstateInput = "(W8654 (O59T66o4A npFdZ \"8\" '=' S) hUI6Mf545 --9\n 'F')", pstateOffset = 0, pstateSourcePos = SourcePos {sourceName = "", sourceLine = Pos 1, sourceColumn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}}) /= Right (ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "W8654"))),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "O59T66o4A"))),Left (EAtom (Id (VarId "npFdZ"))),Left (EAtom (Literal (StringLit "8"))),Left (EAtom (Literal (CharLit '='))),Left (EAtom (Id (TypeId "S")))]))),Left (EAtom (Id (VarId "hUI6Mf545"))),Right (Comment "9"),Left (EAtom (Literal (CharLit 'F')))])))

  To rerun use: --match "/parsing Expressions/parsing expression is the inverse of pretty printing it/"

  test/CheckSpec.hs:51:5: 
  2) parsing Expressions parsing a sequence of expressions is the inverse of pretty printing it
       Falsifiable (after 2 tests):
         ExpSeq [Left (EAtom (Id (VarId "_"))),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (VarId "zb872H"))),Left (EAtom (Literal (CharLit '6'))),Right (Comment "%"),Left (EAtom (Literal (FloatLit "0.6115096")))]))),Right (Comment "O"),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "L802"))),Left (EAtom (Literal (StringLit ""))),Left (EAtom (Literal (StringLit ""))),Right (Comment "="),Left (EAtom (Literal (IntLit "1")))]))),Left (EAtom (Id (VarId "~&~="))),Right (Comment "0")]
         Left (ParseErrorBundle {bundleErrors = TrivialError 19 (Just (Tokens ('0' :| ""))) (fromList [Tokens (')' :| "")]) :| [], bundlePosState = PosState {pstateInput = "_ (zb872H '6' --%\n 0.6115096) --O\n (L802 \"\" \"\" --=\n 1) ~&~= --0\n", pstateOffset = 0, pstateSourcePos = SourcePos {sourceName = "", sourceLine = Pos 1, sourceColumn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}}) /= Right (ExpSeq [Left (EAtom (Id (VarId "_"))),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (VarId "zb872H"))),Left (EAtom (Literal (CharLit '6'))),Right (Comment "%"),Left (EAtom (Literal (FloatLit "0.6115096")))]))),Right (Comment "O"),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "L802"))),Left (EAtom (Literal (StringLit ""))),Left (EAtom (Literal (StringLit ""))),Right (Comment "="),Left (EAtom (Literal (IntLit "1")))]))),Left (EAtom (Id (VarId "~&~="))),Right (Comment "0")])

  To rerun use: --match "/parsing Expressions/parsing a sequence of expressions is the inverse of pretty printing it/"

  test/CheckSpec.hs:51:5: 
  3) parsing Expressions parsing s-expression is the inverse of pretty printing it
       Falsifiable (after 2 tests):
         Sexp (ExpSeq [Left (EAtom (Id (VarId "_"))),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (VarId "zb872H"))),Left (EAtom (Literal (CharLit '6'))),Right (Comment "%"),Left (EAtom (Literal (FloatLit "0.6115096")))]))),Right (Comment "O"),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "L802"))),Left (EAtom (Literal (StringLit ""))),Left (EAtom (Literal (StringLit ""))),Right (Comment "="),Left (EAtom (Literal (IntLit "1")))]))),Left (EAtom (Id (VarId "~&~="))),Right (Comment "0")])
         Left (ParseErrorBundle {bundleErrors = TrivialError 20 (Just (Tokens ('0' :| ""))) (fromList [Tokens (')' :| "")]) :| [], bundlePosState = PosState {pstateInput = "(_ (zb872H '6' --%\n 0.6115096) --O\n (L802 \"\" \"\" --=\n 1) ~&~= --0\n)", pstateOffset = 0, pstateSourcePos = SourcePos {sourceName = "", sourceLine = Pos 1, sourceColumn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}}) /= Right (Sexp (ExpSeq [Left (EAtom (Id (VarId "_"))),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (VarId "zb872H"))),Left (EAtom (Literal (CharLit '6'))),Right (Comment "%"),Left (EAtom (Literal (FloatLit "0.6115096")))]))),Right (Comment "O"),Left (ESexp (Sexp (ExpSeq [Left (EAtom (Id (TypeId "L802"))),Left (EAtom (Literal (StringLit ""))),Left (EAtom (Literal (StringLit ""))),Right (Comment "="),Left (EAtom (Literal (IntLit "1")))]))),Left (EAtom (Id (VarId "~&~="))),Right (Comment "0")]))

  To rerun use: --match "/parsing Expressions/parsing s-expression is the inverse of pretty printing it/"

Randomized with seed 156114697

Finished in 0.0362 sec
axolotl-0.1.0.0: Test suite axolotl-test failed
Completed 2 action(s).
Test suite failure for package axolotl-0.1.0.0
    axolotl-test:  exited with: ExitFailure 1
Logs printed to console

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.