cimple 0.0.24 → 0.0.25
raw patch · 8 files changed
+21/−13 lines, 8 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Language.Cimple: TyUnion :: lexeme -> NodeF lexeme a
+ Language.Cimple: class HasLocation a
+ Language.Cimple: describeLexeme :: Show a => Lexeme a -> String
+ Language.Cimple: describeNode :: Show a => Node a -> String
+ Language.Cimple: parseError :: Show text => (Lexeme text, [String]) -> Alex a
+ Language.Cimple: sloc :: HasLocation a => FilePath -> a -> Text
Files
- cimple.cabal +1/−1
- src/Language/Cimple.hs +10/−9
- src/Language/Cimple/Ast.hs +1/−0
- src/Language/Cimple/DescribeAst.hs +3/−3
- src/Language/Cimple/MapAst.hs +2/−0
- src/Language/Cimple/Parser.y +1/−0
- src/Language/Cimple/Pretty.hs +1/−0
- src/Language/Cimple/TraverseAst.hs +2/−0
cimple.cabal view
@@ -1,5 +1,5 @@ name: cimple-version: 0.0.24+version: 0.0.25 synopsis: Simple C-like programming language homepage: https://toktok.github.io/ license: GPL-3
src/Language/Cimple.hs view
@@ -5,16 +5,17 @@ , removeSloc ) where -import Control.Monad.State.Strict (State)-import qualified Control.Monad.State.Strict as State-import Data.Text (Text)+import Control.Monad.State.Strict (State)+import qualified Control.Monad.State.Strict as State+import Data.Text (Text) -import Language.Cimple.Annot as X-import Language.Cimple.Ast as X-import Language.Cimple.Lexer as X-import Language.Cimple.MapAst as X-import Language.Cimple.Parser as X-import Language.Cimple.Tokens as X+import Language.Cimple.Annot as X+import Language.Cimple.Ast as X+import Language.Cimple.DescribeAst as X+import Language.Cimple.Lexer as X+import Language.Cimple.MapAst as X+import Language.Cimple.Parser as X+import Language.Cimple.Tokens as X type DefaultActions a = X.IdentityActions (State a) Text
src/Language/Cimple/Ast.hs view
@@ -110,6 +110,7 @@ | TyNullable a | TyPointer a | TyStruct lexeme+ | TyUnion lexeme | TyFunc lexeme | TyStd lexeme | TyUserDefined lexeme
src/Language/Cimple/DescribeAst.hs view
@@ -146,9 +146,9 @@ describeExpected options | wants ["break", "const", "continue", "ID_CONST", "VLA"] = "statement or declaration" | wants ["ID_FUNC_TYPE", "non_null", "static", "'#include'"] = "top-level declaration or definition"- | options == ["ID_FUNC_TYPE", "ID_STD_TYPE", "ID_SUE_TYPE", "struct", "void"] = "top-level type specifier"- | options == ["ID_STD_TYPE", "ID_SUE_TYPE", "struct", "void"] = "type specifier"- | options == ["ID_STD_TYPE", "ID_SUE_TYPE", "bitwise", "const", "force", "struct", "void"] = "type specifier"+ | options == ["ID_FUNC_TYPE", "ID_STD_TYPE", "ID_SUE_TYPE", "struct", "union", "void"] = "top-level type specifier"+ | options == ["ID_STD_TYPE", "ID_SUE_TYPE", "struct", "union", "void"] = "type specifier"+ | options == ["ID_STD_TYPE", "ID_SUE_TYPE", "bitwise", "const", "force", "struct", "union", "void"] = "type specifier" | options == ["ID_CONST", "ID_VAR", "LIT_CHAR", "LIT_FALSE", "LIT_INTEGER", "'{'"] = "constant or literal" | ["ID_FUNC_TYPE", "ID_STD_TYPE", "ID_SUE_TYPE", "ID_VAR"] `isPrefixOf` options = "type specifier or variable name" | ["ID_FUNC_TYPE", "ID_STD_TYPE", "ID_SUE_TYPE", "bitwise", "const"] `isPrefixOf` options = "type specifier"
src/Language/Cimple/MapAst.hs view
@@ -343,6 +343,8 @@ Fix <$> (TyPointer <$> recurse ty) TyStruct name -> Fix <$> (TyStruct <$> recurse name)+ TyUnion name ->+ Fix <$> (TyUnion <$> recurse name) TyFunc name -> Fix <$> (TyFunc <$> recurse name) TyStd name ->
src/Language/Cimple/Parser.y view
@@ -695,6 +695,7 @@ GlobalLeafType :: { NonTerm } GlobalLeafType : struct ID_SUE_TYPE { Fix $ TyStruct $2 }+| union ID_SUE_TYPE { Fix $ TyUnion $2 } | void { Fix $ TyStd $1 } | ID_STD_TYPE { Fix $ TyStd $1 } | ID_SUE_TYPE { Fix $ TyUserDefined $1 }
src/Language/Cimple/Pretty.hs view
@@ -424,6 +424,7 @@ TyStd l -> dullgreen $ ppLexeme l TyFunc l -> dullgreen $ ppLexeme l TyStruct l -> kwStruct <+> dullgreen (ppLexeme l)+ TyUnion l -> kwUnion <+> dullgreen (ppLexeme l) ExternC decls -> dullmagenta (pretty "#ifdef __cplusplus") <$$>
src/Language/Cimple/TraverseAst.hs view
@@ -442,6 +442,8 @@ recurse ty TyStruct name -> recurse name+ TyUnion name ->+ recurse name TyFunc name -> recurse name TyStd name ->