Skip to content

Commit 804462b

Browse files
authored
Merge pull request scribble#106 from nickng/pkg-documentation
Fix branch documentation
2 parents 6211b5a + e33def0 commit 804462b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎scribble-go/src/main/java/org/scribble/ext/go/core/codegen/statetype3/RPCoreSTBranchActionBuilder.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ public String build(STStateChanApiBuilder api, EState curr, EAction a) // FIXME
2222

2323
EState succ = curr.getSuccessor(a);
2424

25-
//String labels = curr.getAllSuccessors().stream().map(s -> s.getActions().get(0)).map(act -> act.mid.toString()).collect(Collectors.joining(" or "));
25+
String branchComment =
26+
"// " + getActionName(api, a) + " is a branch with branch label\n"
27+
+ "// " + curr.getActions().stream().map(action -> action.mid.toString()).collect(Collectors.joining(" or ")) + "\n";
2628
return
27-
/* "// " + getActionName(api, a) + " is a branch with branch label\n"
28-
//+ "// " + labels + "\n"*/
29-
"func (s *" + getStateChanType(api, curr, a) + ") " + getActionName(api, a) + "("
29+
branchComment
30+
+ "func (s *" + getStateChanType(api, curr, a) + ") " + getActionName(api, a) + "("
3031
+ buildArgs(null, a)
3132
+ ") " + getReturnType(api, curr, succ) + " {\n" // HACK: return type is interface, so no need for *return (unlike other state chans)
3233
+ "if " + RPCoreSTApiGenConstants.GO_IO_METHOD_RECEIVER + "." + RPCoreSTApiGenConstants.GO_SCHAN_ERROR + " != nil {\n"

0 commit comments

Comments
 (0)