lambdacube3d / lambdacube-compiler

LambdaCube 3D is a Haskell-like purely functional language for GPU. Try it out:
http://lambdacube3d.com
Other
85 stars 9 forks source link

Megaparsec 7 compat issues #20

Open deepfire opened 5 years ago

deepfire commented 5 years ago

These crop up while compiling against megaparsec 7.0.4:

[ 8 of 14] Compiling LambdaCube.Compiler.Lexer ( src/LambdaCube/Compiler/Lexer.hs, dist/build/LambdaCube/Compiler/Lexer.o )

src/LambdaCube/Compiler/Lexer.hs:46:22: error:
    Variable not in scope:
      getPosition
        :: RWST
             (ParseEnv r) [w] SPos (Parsec (ErrorFancy Void) String) SourcePos
   |
46 | getSPos = toSPos <$> getPosition
   |                      ^^^^^^^^^^^

src/LambdaCube/Compiler/Lexer.hs:130:24: error:
    • Couldn't match type ‘P.ParseError Char (ErrorFancy Void)’
                     with ‘ParseErrorBundle String (ErrorFancy Void)’
      Expected type: Either
                       (ParseErrorBundle String (ErrorFancy Void)) (a, [w])
                     -> Either ParseError (a, [w])
        Actual type: Either
                       (P.ParseError Char (ErrorFancy Void)) (a, [w])
                     -> Either ParseError (a, [w])
    • In the first argument of ‘(.)’, namely ‘left ParseErr’
      In the expression: left ParseErr . snd . flip runParser' st
      In the expression:
        left ParseErr . snd . flip runParser' st
          $ evalRWST p env (error "spos")
    |
130 | runParse p (env, st) = left ParseErr . snd . flip runParser' st $ evalRWST p env (error "spos")