Skip to content

Commit

Permalink
Update syntax.md
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Apr 22, 2024
1 parent 8b2255c commit 3fd7d02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ _literal_ ::= _string-literal_
| `false`

_proc_ ::= `^` _parameters?_ _self-type-binding?_ _block?_ `->` _type_
| `^` `(` `?` `)` _self-type-binding?_ _block?_ `->` _type_ # Proc type with untyped parameter
```

### Class instance type
Expand Down Expand Up @@ -310,6 +311,7 @@ end

```markdown
_method-type_ ::= _parameters?_ _block?_ `->` _type_ # Method type
| `(` `?` `)` `->` _type_ # Method type with untyped parameters

_parameters?_ ::= (Empty)
| _parameters_ (Parameters)
Expand All @@ -333,9 +335,11 @@ _var-name_ ::= /[a-z]\w*/
_self-type-binding?_ = (Empty)
| `[` `self` `:` _type_ `]` (Self type binding)

_block?_ = (No block)
_block?_ = (No block)
| `{` _parameters_ _self-type-binding?_ `->` _type_ `}` (Block)
| `{` `(` `?` `)` `->` _type_ `}` (Block with untyped parameters)
| `?` `{` _parameters_ _self-type-binding?_ `->` _type_ `}` (Optional block)
| `?` `{` `(` `?` `)` `->` _type_ `}` (Optional block with untyped parameters)
```

### Parameters
Expand Down

0 comments on commit 3fd7d02

Please sign in to comment.