Add local function definitions
This commit is contained in:
parent
b590f640f4
commit
86006933d7
2 changed files with 19 additions and 10 deletions
13
README.md
13
README.md
|
|
@ -129,8 +129,11 @@ function() '{
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Sugar | Desugared |
|
| Sugar | Desugared |
|
||||||
|------------------------|---------------------------------|
|
|----------------------------|------------------------------|
|
||||||
| `function foo() a` | `foo = function() a` |
|
| `function foo() a` | `foo = function() a` |
|
||||||
| `function foo(a) b` | `foo = function(a) b` |
|
| `function foo(a) b` | `foo = function(a) b` |
|
||||||
| `function foo{..} a` | `foo = function{..} a` |
|
| `function foo{..} a` | `foo = function{..} a` |
|
||||||
|
| `local function foo() a` | `local foo = function() a` |
|
||||||
|
| `local function foo(a) b` | `local foo = function(a) b` |
|
||||||
|
| `local function foo{..} a` | `local foo = function{..} a` |
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,12 @@ pub enum FuncDef {
|
||||||
span: Span,
|
span: Span,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// `function foo() a`
|
/// - `function foo() a`
|
||||||
|
/// - `local function foo() a`
|
||||||
///
|
///
|
||||||
/// Structure: `function s0 name s1 ( s2 ) s3 body`
|
/// Structure: `local function s0 name s1 ( s2 ) s3 body`
|
||||||
NamedNoArg {
|
NamedNoArg {
|
||||||
|
local: Option<Space>,
|
||||||
s0: Space,
|
s0: Space,
|
||||||
name: Ident,
|
name: Ident,
|
||||||
s1: Space,
|
s1: Space,
|
||||||
|
|
@ -52,10 +54,12 @@ pub enum FuncDef {
|
||||||
span: Span,
|
span: Span,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// `function foo(bar) a`
|
/// - `function foo(bar) a`
|
||||||
|
/// - `local function foo(bar) a`
|
||||||
///
|
///
|
||||||
/// Structure: `function s0 name s1 ( s2 arg s3 ) s4 body`
|
/// Structure: `local function s0 name s1 ( s2 arg s3 ) s4 body`
|
||||||
NamedArg {
|
NamedArg {
|
||||||
|
local: Option<Space>,
|
||||||
s0: Space,
|
s0: Space,
|
||||||
name: Ident,
|
name: Ident,
|
||||||
s1: Space,
|
s1: Space,
|
||||||
|
|
@ -68,9 +72,11 @@ pub enum FuncDef {
|
||||||
},
|
},
|
||||||
|
|
||||||
/// `function foo{..} a`
|
/// `function foo{..} a`
|
||||||
|
/// `local function foo{..} a`
|
||||||
///
|
///
|
||||||
/// Structure: `function s0 name s1 pattern s2 body`
|
/// Structure: `local function s0 name s1 pattern s2 body`
|
||||||
NamedDestr {
|
NamedDestr {
|
||||||
|
local: Option<Space>,
|
||||||
s0: Space,
|
s0: Space,
|
||||||
name: Ident,
|
name: Ident,
|
||||||
s1: Space,
|
s1: Space,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue