language-lua 0.3.0 → 0.3.1
raw patch · 3 files changed
+81/−14 lines, 3 files
Files
- dist/build/Language/Lua/Annotated/Lexer.hs +71/−13
- language-lua.cabal +5/−1
- src/Language/Lua/Parser.hs +5/−0
dist/build/Language/Lua/Annotated/Lexer.hs view
@@ -36,6 +36,34 @@ {-# LINE 1 "templates/wrappers.hs" #-} {-# LINE 1 "templates/wrappers.hs" #-} {-# LINE 1 "<command-line>" #-}+{-# LINE 10 "<command-line>" #-}+# 1 "/usr/include/stdc-predef.h" 1 3 4++# 17 "/usr/include/stdc-predef.h" 3 4++++++++++++++++++++++++{-# LINE 10 "<command-line>" #-} {-# LINE 1 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Alex wrapper code.@@ -96,11 +124,11 @@ in p' `seq` Just (b, (p', c, bs, s)) -{-# LINE 89 "templates/wrappers.hs" #-}+{-# LINE 92 "templates/wrappers.hs" #-} -{-# LINE 103 "templates/wrappers.hs" #-}+{-# LINE 106 "templates/wrappers.hs" #-} -{-# LINE 118 "templates/wrappers.hs" #-}+{-# LINE 121 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Token positions@@ -227,21 +255,21 @@ -- ----------------------------------------------------------------------------- -- Monad (with ByteString input) -{-# LINE 328 "templates/wrappers.hs" #-}+{-# LINE 333 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper -{-# LINE 355 "templates/wrappers.hs" #-}+{-# LINE 360 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper, ByteString version -{-# LINE 373 "templates/wrappers.hs" #-}+{-# LINE 378 "templates/wrappers.hs" #-} -{-# LINE 386 "templates/wrappers.hs" #-}+{-# LINE 392 "templates/wrappers.hs" #-} -- -----------------------------------------------------------------------------@@ -249,13 +277,13 @@ -- Adds text positions to the basic model. -{-# LINE 403 "templates/wrappers.hs" #-}+{-# LINE 409 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Posn wrapper, ByteString version -{-# LINE 418 "templates/wrappers.hs" #-}+{-# LINE 424 "templates/wrappers.hs" #-} -- -----------------------------------------------------------------------------@@ -511,6 +539,34 @@ {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<command-line>" #-}+{-# LINE 10 "<command-line>" #-}+# 1 "/usr/include/stdc-predef.h" 1 3 4++# 17 "/usr/include/stdc-predef.h" 3 4++++++++++++++++++++++++{-# LINE 10 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE@@ -527,6 +583,7 @@ +-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. #if __GLASGOW_HASKELL__ > 706 #define GTE(n,m) (tagToEnum# (n >=# m)) #define EQ(n,m) (tagToEnum# (n ==# m))@@ -534,11 +591,11 @@ #define GTE(n,m) (n >=# m) #define EQ(n,m) (n ==# m) #endif-{-# LINE 50 "templates/GenericTemplate.hs" #-}+{-# LINE 51 "templates/GenericTemplate.hs" #-} data AlexAddr = AlexA# Addr#-+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. #if __GLASGOW_HASKELL__ < 503 uncheckedShiftL# = shiftL# #endif@@ -581,6 +638,7 @@ + #if __GLASGOW_HASKELL__ < 503 quickIndex arr i = arr ! i #else@@ -669,7 +727,7 @@ check_accs (AlexAccNone) = last_acc check_accs (AlexAcc a ) = AlexLastAcc a input (I# (len)) check_accs (AlexAccSkip) = AlexLastSkip input (I# (len))-{-# LINE 196 "templates/GenericTemplate.hs" #-}+{-# LINE 198 "templates/GenericTemplate.hs" #-} data AlexLastAcc a = AlexNone@@ -685,7 +743,7 @@ = AlexAccNone | AlexAcc a | AlexAccSkip-{-# LINE 240 "templates/GenericTemplate.hs" #-}+{-# LINE 242 "templates/GenericTemplate.hs" #-} -- used by wrappers iUnbox (I# (i)) = i
language-lua.cabal view
@@ -2,6 +2,10 @@ Description: Lua 5.2 lexer, parser and pretty-printer. Documentation: (<https://osa1.github.com/language-lua>) . Changelog:+ \0.3.1:+ .+ - Fixed incorrectly exported name `exp` in `Language.Lua.Parser` module.+ . \0.3.0: . - Added non-annotated syntax to make code-generation easier.@@ -17,7 +21,7 @@ \0.2.0: . - Syntax tree is annotated. All parsers(`parseText`, `parseFile`) annotate resulting tree with source positions.-Version: 0.3.0+Version: 0.3.1 Synopsis: Lua parser and pretty-printer Homepage: http://github.com/osa1/language-lua Bug-reports: http://github.com/osa1/language-lua/issues
src/Language/Lua/Parser.hs view
@@ -14,6 +14,8 @@ import Text.Parsec.LTok import Control.Monad (liftM) +import Prelude hiding (exp)+ parseText :: Parser a -> String -> Either ParseError a parseText = A.parseText @@ -22,6 +24,9 @@ stat :: Parser Stat stat = fmap sStat A.stat++exp :: Parser Exp+exp = fmap sExp A.exp chunk :: Parser Block chunk = fmap sBlock A.chunk