cimple 0.0.18 → 0.0.19
raw patch · 6 files changed
+32/−21 lines, 6 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Language.Cimple: CmtStartCode :: LexemeClass
+ Language.Cimple.MapAst: data AstActions f itext otext
+ Language.Cimple.MapAst: mapFileAst :: (MapAst itext otext a, Applicative f, HasCallStack) => AstActions f itext otext -> FilePath -> a -> f (Mapped itext otext a)
- Language.Cimple.MapAst: mapAst :: (MapAst itext otext a, Applicative f) => AstActions f itext otext -> a -> f (Mapped itext otext a)
+ Language.Cimple.MapAst: mapAst :: (MapAst itext otext a, Applicative f, HasCallStack) => AstActions f itext otext -> a -> f (Mapped itext otext a)
Files
- LICENSE +4/−5
- cimple.cabal +1/−1
- src/Language/Cimple/Lexer.x +15/−8
- src/Language/Cimple/MapAst.hs +9/−7
- src/Language/Cimple/Parser.y +2/−0
- src/Language/Cimple/Tokens.hs +1/−0
LICENSE view
@@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License- along with this program. If not, see <http://www.gnu.org/licenses/>.+ along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. @@ -664,12 +664,11 @@ You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see-<http://www.gnu.org/licenses/>.+<https://www.gnu.org/licenses/>. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read-<http://www.gnu.org/philosophy/why-not-lgpl.html>.-+<https://www.gnu.org/licenses/why-not-lgpl.html>.
cimple.cabal view
@@ -1,5 +1,5 @@ name: cimple-version: 0.0.18+version: 0.0.19 synopsis: Simple C-like programming language homepage: https://toktok.github.io/ license: GPL-3
src/Language/Cimple/Lexer.x view
@@ -38,24 +38,27 @@ <0> "VLA" { mkL KwVla } -- Winapi functions.-<0> "WSAAddressToString" { mkL IdVar }-<0> "LocalFree" { mkL IdVar } <0> "FormatMessageA" { mkL IdVar }-<0> "WSAGetLastError" { mkL IdVar }-<0> "WSAStringToAddress" { mkL IdVar }-<0> "WSAStartup" { mkL IdVar } <0> "GetAdaptersInfo" { mkL IdVar }-<0> "WSACleanup" { mkL IdVar } <0> "GetSystemTimeAsFileTime" { mkL IdVar } <0> "GetTickCount" { mkL IdVar }+<0> "LocalFree" { mkL IdVar }+<0> "QueryPerformanceCounter" { mkL IdVar }+<0> "QueryPerformanceFrequency" { mkL IdVar } <0> "SecureZeroMemory" { mkL IdVar }+<0> "WSAAddressToString" { mkL IdVar }+<0> "WSACleanup" { mkL IdVar }+<0> "WSAGetLastError" { mkL IdVar }+<0> "WSAStartup" { mkL IdVar }+<0> "WSAStringToAddress" { mkL IdVar } -- Winapi struct members. <0> "GatewayList" { mkL IdVar }-<0> "Next" { mkL IdVar }-<0> "IpAddress" { mkL IdVar } <0> "IpAddressList" { mkL IdVar }+<0> "IpAddress" { mkL IdVar } <0> "IpMask" { mkL IdVar }+<0> "Next" { mkL IdVar }+<0> "QuadPart" { mkL IdVar } <0> "String" { mkL IdVar } -- Windows typedefs.@@ -66,6 +69,8 @@ <0> "IP_ADAPTER_INFO" { mkL IdStdType } <0> "LPTSTR" { mkL IdStdType } <0> "u_long" { mkL IdStdType }+<0> "LARGE_INTEGER" { mkL IdStdType }+<0> "SOCKET" { mkL IdStdType } <0> "WSADATA" { mkL IdStdType } -- System struct types.@@ -127,6 +132,8 @@ <0> [\ \n]+ ; <0> $white { mkE ErrorToken } <0> "//!TOKSTYLE-" { mkL IgnStart `andBegin` ignoreSC }+<0> "/*!" { mkL CmtStartCode }+<0> "*/" { mkL CmtEnd } <0> "/*" { mkL CmtStart `andBegin` cmtSC } <0> "/**" { mkL CmtStartDoc `andBegin` cmtSC } <0> "/** @{" { mkL CmtStartDocSection `andBegin` cmtSC }
src/Language/Cimple/MapAst.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-}@@ -6,7 +7,7 @@ {-# LANGUAGE Strict #-} {-# LANGUAGE TypeFamilies #-} module Language.Cimple.MapAst- ( mapAst+ ( mapAst, mapFileAst , doFiles, doFile , doNodes, doNode@@ -14,12 +15,13 @@ , doLexemes, doLexeme , doText - , astActions+ , AstActions, astActions , TextActions, textActions , IdentityActions, identityActions ) where import Data.Fix (Fix (..))+import GHC.Stack (HasCallStack) import Language.Cimple.Ast (Comment, CommentF (..), Node, NodeF (..)) import Language.Cimple.Lexer (Lexeme (..))@@ -27,14 +29,14 @@ class MapAst itext otext a where type Mapped itext otext a mapFileAst- :: Applicative f+ :: (Applicative f, HasCallStack) => AstActions f itext otext -> FilePath -> a -> f (Mapped itext otext a) mapAst- :: (MapAst itext otext a, Applicative f)+ :: (MapAst itext otext a, Applicative f, HasCallStack) => AstActions f itext otext -> a -> f (Mapped itext otext a) mapAst = flip mapFileAst "<stdin>"@@ -86,7 +88,7 @@ instance MapAst itext otext (Lexeme itext) where type Mapped itext otext (Lexeme itext) = Lexeme otext- mapFileAst :: forall f . Applicative f+ mapFileAst :: (Applicative f, HasCallStack) => AstActions f itext otext -> FilePath -> Lexeme itext -> f (Lexeme otext) mapFileAst AstActions{..} currentFile = doLexeme currentFile <*> \(L p c s) -> L p c <$> doText currentFile s@@ -101,7 +103,7 @@ type Mapped itext otext (Comment (Lexeme itext)) = Comment (Lexeme otext) mapFileAst- :: forall f . Applicative f+ :: forall f. (Applicative f, HasCallStack) => AstActions f itext otext -> FilePath -> Comment (Lexeme itext)@@ -177,7 +179,7 @@ type Mapped itext otext (Node (Lexeme itext)) = Node (Lexeme otext) mapFileAst- :: forall f . Applicative f+ :: forall f . (Applicative f, HasCallStack) => AstActions f itext otext -> FilePath -> Node (Lexeme itext)
src/Language/Cimple/Parser.y view
@@ -126,6 +126,7 @@ '#undef' { L _ PpUndef _ } '\n' { L _ PpNewline _ } '/*' { L _ CmtStart _ }+ '/*!' { L _ CmtStartCode _ } '/**' { L _ CmtStartDoc _ } '/** @{' { L _ CmtStartDocSection _ } '/** @} */' { L _ CmtEndDocSection _ }@@ -439,6 +440,7 @@ DeclSpecArray : '[' ']' { Fix $ DeclSpecArray Nothing } | '[' Expr ']' { Fix $ DeclSpecArray (Just $2) }+| '[' '/*!' Expr '*/' ']' { Fix $ DeclSpecArray (Just $3) } InitialiserExpr :: { NonTerm } InitialiserExpr
src/Language/Cimple/Tokens.hs view
@@ -109,6 +109,7 @@ | CmtPrefix | CmtIndent | CmtStart+ | CmtStartCode | CmtStartBlock | CmtStartDoc | CmtStartDocSection