-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to directly access members of anonymous bitfields.
This works now: type Foo = unit { : bitfield(8) { x: 0..3; y: 4..7; }; on %done { print self.x, self.y; } }; Closes #1468.
- Loading branch information
Showing
11 changed files
with
108 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. | ||
[error] unit 'Test::Bar' has multiple anonymous bitfields with member 'x' | ||
[error] spicyc: errors encountered during normalizing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. | ||
[error] <...>/anonymous-fail.spicy:8:12-11:5: field 'x' of anonymous bitfield clashes with other unit field | ||
[error] spicyc: aborting after errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. | ||
15, 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# @TEST-EXEC-FAIL: spicyc -c %INPUT >output 2>&1 | ||
# @TEST-EXEC: btest-diff output | ||
# @TEST-DOC: Check thqt an anonymous bitfield's field name cannot shadow other fields. | ||
|
||
module Test; | ||
|
||
type Foo = unit { | ||
x: uint8; | ||
: bitfield(8) { | ||
x: 0..3; | ||
}; | ||
}; | ||
|
||
# @TEST-START-NEXT | ||
|
||
module Test; | ||
|
||
type Bar = unit { | ||
: bitfield(8) { | ||
x: 0..3; | ||
}; | ||
: bitfield(8) { | ||
x: 0..3; | ||
}; | ||
|
||
on %done { print self.x; } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# @TEST-EXEC: printf '\377' | spicy-driver %INPUT >output | ||
# @TEST-EXEC: btest-diff output | ||
|
||
module Test; | ||
|
||
public type Foo = unit { | ||
: bitfield(8) { | ||
x: 0..3; | ||
y: 4..7; | ||
}; | ||
|
||
on %done { | ||
print self.x, self.y; | ||
} | ||
}; |