Skip to content

Commit

Permalink
Fix empty service bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
q-uint committed Mar 19, 2024
1 parent a6300a8 commit a46d9f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion candid/internal/candid/grammar.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ func ActorType(p *ast.Parser) (*ast.Node, error) {
TypeStrings: NodeTypes,
Value: op.And{
'{',
Ws,
op.Optional(
op.And{
Ws,
MethType,
op.MinZero(
op.And{
Expand Down
2 changes: 1 addition & 1 deletion candid/internal/candid/grammar.pegn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Type <-- 'type' Sp Id Sp '=' Sp DataType
Import <-- 'import' Sp Text
Actor <-- 'service' Sp? (Id Sp)? ':' Sp (TupType Sp '->' Ws)? (ActorType / Id)

ActorType <-- '{' (Ws MethType (';' Ws MethType)* ';'? Ws)? '}'
ActorType <-- '{' Ws (MethType (';' Ws MethType)* ';'? Ws)? '}'
MethType <-- Name Sp? ':' Ws (FuncType / Id)
FuncType <-- TupType (Sp '->' Ws TupType (Sp FuncAnn)?)?
FuncAnn <-- 'oneway' / 'query'
Expand Down

0 comments on commit a46d9f4

Please sign in to comment.