diff options
-rw-r--r-- | src/Language/Fiddle/Compiler/Qualification.hs | 6 | ||||
-rwxr-xr-x | test/integrations/anonymous_parsed/test.sh | 2 | ||||
-rw-r--r-- | test/integrations/simple_using/common.fdi | bin | 0 -> 342 bytes | |||
-rw-r--r-- | test/integrations/simple_using/common.fdl | 3 | ||||
-rwxr-xr-x | test/integrations/simple_using/test.sh | 7 | ||||
-rw-r--r-- | test/integrations/simple_using/using.fdl | 13 |
6 files changed, 27 insertions, 4 deletions
diff --git a/src/Language/Fiddle/Compiler/Qualification.hs b/src/Language/Fiddle/Compiler/Qualification.hs index eae219e..103c7a1 100644 --- a/src/Language/Fiddle/Compiler/Qualification.hs +++ b/src/Language/Fiddle/Compiler/Qualification.hs @@ -410,7 +410,7 @@ advanceFiddleDecls localState decls = fmap (reverse . fst) $ do let (qualifiedName, _) = pushObject (fmap identToString ids) - localState + localState' in do sizeBits <- getBitTypeDeclaredSize typ let decl = @@ -428,7 +428,7 @@ advanceFiddleDecls localState decls = fmap (reverse . fst) $ do let (qualifiedName, localState'') = pushObject (fmap identToString ids) - localState + localState' in do typeSize <- calculateTypeSize =<< resolveOrFail body let decl = @@ -446,7 +446,7 @@ advanceFiddleDecls localState decls = fmap (reverse . fst) $ do let qualifiedName = fmap (const $ identToString ident) - (currentQualifiedPath localState) + (currentQualifiedPath localState') in do location <- resolveLocationExpression localState' loc typ' <- advanceStage localState' typ diff --git a/test/integrations/anonymous_parsed/test.sh b/test/integrations/anonymous_parsed/test.sh index 9bcb6a6..9bdc52b 100755 --- a/test/integrations/anonymous_parsed/test.sh +++ b/test/integrations/anonymous_parsed/test.sh @@ -2,7 +2,7 @@ source "$(git rev-parse --show-toplevel)/test/integrations/common.sh" output=$( - stack run -- --dump-parsed input.fdl | + stack run -- -Lnull --dump-parsed input.fdl | jq '.. | objects | select(._con == "RegisterBitsAnonymousType") diff --git a/test/integrations/simple_using/common.fdi b/test/integrations/simple_using/common.fdi Binary files differnew file mode 100644 index 0000000..5de2556 --- /dev/null +++ b/test/integrations/simple_using/common.fdi diff --git a/test/integrations/simple_using/common.fdl b/test/integrations/simple_using/common.fdl new file mode 100644 index 0000000..2b93be2 --- /dev/null +++ b/test/integrations/simple_using/common.fdl @@ -0,0 +1,3 @@ +package common { + bits bit_t : (1); +}; diff --git a/test/integrations/simple_using/test.sh b/test/integrations/simple_using/test.sh new file mode 100755 index 0000000..4195162 --- /dev/null +++ b/test/integrations/simple_using/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +source "$(git rev-parse --show-toplevel)/test/integrations/common.sh" + +stack run -- -Lnull using.fdl --import . + +finish diff --git a/test/integrations/simple_using/using.fdl b/test/integrations/simple_using/using.fdl new file mode 100644 index 0000000..9f2ecac --- /dev/null +++ b/test/integrations/simple_using/using.fdl @@ -0,0 +1,13 @@ +import "common.fdl"; + +package testuse { + using common; + + type main_type : struct { + reg (32) : struct { + enabled : bit_t; + reserved(31); + }; + }; + +}; |