Permalink
Commits on May 26, 2016
  1. GenericTemplate.hs: workaround GHC 7.6 type checking failure

    da-x committed May 26, 2016
    Even with an exact type signature for unbox_int and indexShortOffAddr
    GHC 7.6 fails to realize the type for the second parameter of
    indexShortOffAddr which needs to be of unboxed kind '#' instead
    of boxed '*'.
    
        Couldn't match kind `#' against `*'
        In the second argument of `indexShortOffAddr', namely
          `(unbox_int $ bit `div` 16)'
    
    It's probably due to `div`. Figured out we can use unboxed right
    shift instead, to get it straight.
    
    Tested with GHC 7.6.3, GHC 7.8.4, and GHC 7.10.3.
    
    Signed-off-by: Dan Aloni <dan@kernelim.com>
  2. Merge pull request simonmar#46 from da-x/master

    simonmar committed May 26, 2016
    RFC: On parse error - show the next possible tokens
  3. Merge pull request simonmar#67 from da-x/fix-produce-code

    simonmar committed May 26, 2016
    Fix ProduceCode.hs for GHC 7.10.x
Commits on May 19, 2016
  1. Fix ProduceCode.hs for GHC 7.10.x

    da-x committed May 19, 2016
    Adding the type signature takes care of this error:
    
    ../dist/build/happy/happy --strict --template=.. -g monad002.ly -o monad002.g.hs
    ghc -hide-all-packages -package base -package array -package mtl -Werror -fforce-recomp  monad002.g.hs -o monad002.g.bin
    [1 of 1] Compiling Main             ( monad002.g.hs, monad002.g.o )
    
    monad002.g.hs:311:22:
        Couldn't match kind ‘*’ with ‘#’
        When matching types
          t0 :: *
          Happy_GHC_Exts.Int# :: #
    
    And 'cabal test' pass. Tested with GHC 7.8.4 too.
    
    Signed-off-by: Dan Aloni <dan@kernelim.com>
Commits on May 17, 2016
  1. Try to fix travis

    simonmar committed May 17, 2016
  2. bump version to 1.19.6

    simonmar committed May 17, 2016
  3. Add .travis.yml

    simonmar committed May 17, 2016
  4. Merge pull request simonmar#63 from ndmitchell/test-suite-windows

    simonmar committed May 17, 2016
    Make the test suite work on Windows
  5. Merge pull request simonmar#66 from ndmitchell/fold-lookahead

    simonmar committed May 17, 2016
    Rewrite fold_lookahead to avoid using the stack and improve time complexity
Commits on May 16, 2016
  1. Merge pull request simonmar#65 from ndmitchell/space-leaks

    simonmar committed May 16, 2016
    Add a missing import following simonmar#64
  2. Fix spaceLeak in countConflicts

    ndmitchell committed May 16, 2016
    Using a `foldr` to do a summation, resulting in a space leak. Fixed by switching to `foldl'` and then forcing the elements inside the pair.
  3. Fix space leak in indexInto

    ndmitchell committed May 16, 2016
    Classic foldl with a lazy accumulator. Alternatively, the entire `indexInto` function could be replaced with `Data.List.elemIndex`.
  4. Make the test suite work on Windows

    ndmitchell committed May 16, 2016
    Windows writes out files to stdout and stderr with Windows newlines in, but the sample files are Linux newlines. To make sure `diff` doesn't fail we ignore the whitespace, which includes ignoring newline differences.
Commits on Mar 19, 2016
  1. Reduce explist's contribution to the parser's object code size

    da-x committed Apr 20, 2015
    Long list of literal strings, one string for each possible token
    in a state, increases parser object size significantly.
    
    Instead,
    
     * Use a bit matrix of the possiblility of a token in a state,
       generated along with the other parser tables.
     * Data.Array is now always imported, for storing the array.
     * Instead of inlining the result of possibleShifts, we now
       have a compact produceExpListArray that we can use in both
       the array-based parser and the non-array-based parser.
    
    Signed-off-by: Dan Aloni <dan@kernelim.com>
  2. Fixes to 'possible next tokens' feature based on review

    da-x committed Apr 16, 2015
     * Rename %errorsig to %errorhandletype
     * Detect invalid values for %errorhandletype at parsing stage,
       not code generation stage.
     * Document %errorhandlertype
     * Refactoring at the code generation function.
    
    Signed-off-by: Dan Aloni <dan@kernelim.com>
  3. On parse error, allow to report a list of possible next tokens

    da-x committed Apr 5, 2015
    This change introduces the %errorsig attribute, that changes
    the API of the provided handler function. A [String] of
    possible next token can be passed to the function in order
    to provide a better error message to the user.
    
    We need to pass over the list of possible token names to the
    happyFail function. For example:
    
        action_12 (12) = happyShift action_9
        action_12 (13) = happyShift action_10
        action_12 (14) = happyShift action_11
        action_12 (15) = happyShift action_12
        action_12 (5) = happyGoto action_15
        action_12 (6) = happyGoto action_5
        action_12 (7) = happyGoto action_6
        action_12 (8) = happyGoto action_7
        action_12 (9) = happyGoto action_8
        action_12 _ = happyFail ["idT","numT","boolT","\"(\""]
    
    Signed-off-by: Dan Aloni <dan@kernelim.com>
Commits on Mar 16, 2016
  1. Merge pull request simonmar#59 from GetContented/patch-1

    simonmar committed Mar 16, 2016
    Fix spello in examples/Calc.ly
Commits on Mar 11, 2016
  1. Fix spello in exmaples/Calc.ly

    GetContented committed Mar 11, 2016
    Declare vs declair.
Commits on Feb 11, 2016
  1. Merge pull request simonmar#57 from thomie/glr

    simonmar committed Feb 11, 2016
    Fix Generalized LR Parsing with newer GHC
Commits on Feb 10, 2016
  1. Fixup GLR

    thomie committed Feb 9, 2016
  2. Fix examples/igloo

    thomie committed Feb 10, 2016
Commits on Nov 23, 2015
  1. Merge pull request simonmar#55 from hvr/pr/canonical-amp-instances

    simonmar committed Nov 23, 2015
    tab-removal & canonical AMP instance
Commits on Nov 22, 2015
  1. Generate code with canonical Applicative/Monad instances

    hvr committed Nov 22, 2015
    This makes the code a bit more future-proof
  2. Untabify Setup.lhs

    hvr committed Nov 22, 2015
    This avoids those annoying warnings by GHC
Commits on Nov 17, 2015
  1. Merge pull request simonmar#54 from pgarrison/master

    simonmar committed Nov 17, 2015
    Fix parse error when doing lookahead with %^ and %%
Commits on Nov 2, 2015
  1. Fix parse error when doing lookahead with %^ and %%

    pgarrison
    pgarrison committed Nov 2, 2015
Commits on Aug 11, 2015
  1. Merge pull request simonmar#51 from PhilThomas/master

    simonmar committed Aug 11, 2015
    Type signature on parameterized rules