Skip to content

Commit 7fc8edd

Browse files
committed
docs(api): fix sorting and start to reformat the last two plugin pages
1 parent 3ce506a commit 7fc8edd

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/content/api/parser.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,95 @@
11
---
22
title: Parser
33
group: Plugins
4-
sort: 8
4+
sort: 4
55
---
66

77
The parser instance takes a String and callback and will return an expression when there's a match.
88

9-
```javascript
9+
``` js
1010
compiler.parser.plugin("var rewire", function (expr) {
1111
//if you original module has 'var rewire'
1212
//you now have a handle on the expresssion object
1313
return true;
1414
});
1515
```
1616

17+
1718
## `program(ast)` bailing
1819

1920
General purpose plugin interface for the AST of a code fragment.
2021

22+
2123
## `statement(statement: Statement)` bailing
2224

2325
General purpose plugin interface for the statements of the code fragment.
2426

27+
2528
## `call <identifier>(expr: Expression)` bailing
2629

2730
`abc(1)` => `call abc`
2831

2932
`a.b.c(1)` => `call a.b.c`
3033

34+
3135
## `expression <identifier>(expr: Expression)` bailing
3236

3337
`abc` => `expression abc`
3438

3539
`a.b.c` => `expression a.b.c`
3640

41+
3742
## `expression ?:(expr: Expression)` bailing
3843

3944
`(abc ? 1 : 2)` => `expression ?!`
4045

4146
Return a boolean value to omit parsing of the wrong path.
4247

48+
4349
## `typeof <identifier>(expr: Expression)` bailing
4450

4551
`typeof a.b.c` => `typeof a.b.c`
4652

53+
4754
## `statement if(statement: Statement)` bailing
4855

4956
`if(abc) {}` => `statement if`
5057

5158
Return a boolean value to omit parsing of the wrong path.
5259

60+
5361
## `label <labelname>(statement: Statement)` bailing
5462

5563
`xyz: abc` => `label xyz`
5664

65+
5766
## `var <name>(statement: Statement)` bailing
5867

5968
`var abc, def` => `var abc` + `var def`
6069

6170
Return `false` to not add the variable to the known definitions.
6271

72+
6373
## `evaluate <expression type>(expr: Expression)` bailing
6474

6575
Evaluate an expression.
6676

77+
6778
## `evaluate typeof <identifier>(expr: Expression)` bailing
6879

6980
Evaluate the type of an identifier.
7081

82+
7183
## `evaluate Identifier <identifier>(expr: Expression)` bailing
7284

7385
Evaluate a identifier that is a free var.
7486

87+
7588
## `evaluate defined Identifier <identifier>(expr: Expression)` bailing
7689

7790
Evaluate a identifier that is a defined var.
7891

92+
7993
## `evaluate CallExpression .<property>(expr: Expression)` bailing
8094

8195
Evaluate a call to a member function of a successfully evaluated expression.

src/content/api/resolver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Resolver
33
group: Plugins
4-
sort: 5
4+
sort: 3
55
---
66

77
There are three types of resolvers, each used for different types of modules:

0 commit comments

Comments
 (0)