-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Difficulty: Easy — Strip trailing ?/! direction suffix when parsing SIZE operand.
Summary
When a channel parameter has a direction annotation (e.g., monitor?), the SIZE operator should work on it by stripping the direction suffix. Currently SIZE monitor? fails to parse.
Occam syntax
PROC foo([]CHAN OF INT monitor?)
SEQ i = 0 FOR SIZE monitor?
...
Proposed Go mapping
func foo(monitor []chan int) {
for i := 0; i < len(monitor); i++ {
...
}
}The ? suffix is purely a direction annotation and should be stripped when generating the len() call.
Affected files
sort_inside_2.occ(line 294)
Work required
- Parser: When parsing
SIZE, handle the case where the operand identifier has a trailing?or!direction annotation - Codegen: Generate
len(name)with the direction suffix stripped
Part of #43.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels