Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump language-c to 0.6 #120

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions corrode.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library
build-depends: base >=4.8,
array >= 0.4,
containers >= 0.5,
language-c >=0.4 && <0.6,
language-c >=0.6 && <0.7,
markdown-unlit,
pretty,
transformers
Expand All @@ -33,7 +33,7 @@ executable corrode
bytestring,
corrode,
filepath,
language-c >=0.4 && <0.6,
language-c >=0.6 && <0.7,
markdown-unlit,
pretty,
transformers >=0.2
10 changes: 8 additions & 2 deletions src/Language/Rust/Corrode/C.md
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,9 @@ Return the bindings produced for any declarator that did not return
return (catMaybes mbinds)
```

```haskell
interpretDeclarations _ (CStaticAssert {}) = error "FIXME: interpretDeclarations CStaticAssert"
```

Initialization
==============
Expand Down Expand Up @@ -3390,7 +3393,7 @@ process we add any nested declarations of new `struct`, `union`, or
baseTypeOf :: [CDeclSpec] -> EnvMonad s (Maybe CStorageSpec, EnvMonad s IntermediateType)
baseTypeOf specs = do
-- TODO: process attributes and the `inline` keyword
let (storage, _attributes, basequals, basespecs, _inline) = partitionDeclSpecs specs
let (storage, _attributes, basequals, basespecs, _inlineNoReturn, _align) = partitionDeclSpecs specs
mstorage <- case storage of
[] -> return Nothing
[spec] -> return (Just spec)
Expand Down Expand Up @@ -3483,7 +3486,9 @@ only reporting an error if this struct is actually used.

```haskell
singleSpec [CSUType (CStruct CStructTag mident (Just declarations) _ _) _] = do
deferredFields <- fmap concat $ forM declarations $ \ declaration@(CDecl spec decls _) -> do
deferredFields <- fmap concat $ forM declarations $ \ declaration -> case declaration of
CStaticAssert {} -> return []
CDecl spec decls _ -> do
(storage, base) <- baseTypeOf spec
case storage of
Just s -> badSource s "storage class specifier in struct"
Expand Down Expand Up @@ -3756,6 +3761,7 @@ mutable :: [CTypeQualifier a] -> Rust.Mutable
mutable quals = if any (\ q -> case q of CConstQual _ -> True; _ -> False) quals then Rust.Immutable else Rust.Mutable

typeName :: CDecl -> EnvMonad s (Rust.Mutable, CType)
typeName (CStaticAssert {}) = error "FIXME: typeName of CStaticAssert"
typeName decl@(CDecl spec declarators _) = do
(storage, base) <- baseTypeOf spec
case storage of
Expand Down