Skip to content

Commit a825f91

Browse files
Zearinmichaelficarra
authored andcommitted
Update README.md
* Be consistent with applying backtick (`…`) formatting to formally defined `TokenNames`. * Add a few linebreaks after repetitive sections (“formally defined in…”, and “If `strict` flag is true…”) to make things easier when reading as plain-text markdown. * Reduce all heading levels by 1 (and make the first heading an `h1`).
1 parent ffc308e commit a825f91

File tree

1 file changed

+64
-56
lines changed

1 file changed

+64
-56
lines changed

README.md

Lines changed: 64 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils)
1+
# esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils)
22
esutils ([esutils](http://github.com/estools/esutils)) is
33
utility box for ECMAScript language tools.
44

5-
### API
5+
## API
66

7-
### `ast`
7+
## `ast`
88

9-
#### `ast.isExpression(node)`
9+
### `ast.isExpression(node)`
1010

11-
Returns `true` if `node` is an Expression as defined in ECMA262 edition 5.1 section
11+
Returns `true` if `node` is an `Expression` as defined in ECMA262 edition 5.1 section
1212
[11](https://es5.github.io/#x11).
1313

14-
#### `ast.isStatement(node)`
14+
### `ast.isStatement(node)`
1515

16-
Returns `true` if `node` is a Statement as defined in ECMA262 edition 5.1 section
16+
Returns `true` if `node` is a `Statement` as defined in ECMA262 edition 5.1 section
1717
[12](https://es5.github.io/#x12).
1818

19-
#### `ast.isIterationStatement(node)`
19+
### `ast.isIterationStatement(node)`
2020

21-
Returns `true` if `node` is an IterationStatement as defined in ECMA262 edition
21+
Returns `true` if `node` is an `IterationStatement` as defined in ECMA262 edition
2222
5.1 section [12.6](https://es5.github.io/#x12.6).
2323

24-
#### `ast.isSourceElement(node)`
24+
### `ast.isSourceElement(node)`
2525

26-
Returns `true` if `node` is a SourceElement as defined in ECMA262 edition 5.1
26+
Returns `true` if `node` is a `SourceElement` as defined in ECMA262 edition 5.1
2727
section [14](https://es5.github.io/#x14).
2828

29-
#### `ast.trailingStatement(node)`
29+
### `ast.trailingStatement(node)`
3030

3131
Returns `Statement?` if `node` has trailing `Statement`.
3232
```js
@@ -35,9 +35,9 @@ if (cond)
3535
```
3636
When taking this `IfStatement`, returns `consequent;` statement.
3737

38-
#### `ast.isProblematicIfStatement(node)`
38+
### `ast.isProblematicIfStatement(node)`
3939

40-
Returns `true` if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code.
40+
Returns `true` if `node` is a problematic `IfStatement`. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one-to-one JavaScript code.
4141
```js
4242
{
4343
type: 'IfStatement',
@@ -54,100 +54,108 @@ Returns `true` if `node` is a problematic IfStatement. If `node` is a problemati
5454
The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`.
5555

5656

57-
### `code`
57+
## `code`
5858

59-
#### `code.isDecimalDigit(code)`
59+
### `code.isDecimalDigit(code)`
6060

6161
Return `true` if provided code is decimal digit.
6262

63-
#### `code.isHexDigit(code)`
63+
### `code.isHexDigit(code)`
6464

6565
Return `true` if provided code is hexadecimal digit.
6666

67-
#### `code.isOctalDigit(code)`
67+
### `code.isOctalDigit(code)`
6868

6969
Return `true` if provided code is octal digit.
7070

71-
#### `code.isWhiteSpace(code)`
71+
### `code.isWhiteSpace(code)`
7272

73-
Return `true` if provided code is white space. White space characters are formally defined in ECMA262.
73+
Return `true` if provided code is white space.
74+
White space characters are formally defined in ECMA262.
7475

75-
#### `code.isLineTerminator(code)`
76+
### `code.isLineTerminator(code)`
7677

77-
Return `true` if provided code is line terminator. Line terminator characters are formally defined in ECMA262.
78+
Return `true` if provided code is line terminator.
79+
Line terminator characters are formally defined in ECMA262.
7880

79-
#### `code.isIdentifierStart(code)`
81+
### `code.isIdentifierStart(code)`
8082

81-
Return `true` if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262.
83+
Return `true` if provided code can be the first character of ECMA262 `Identifier`.
84+
They are formally defined in ECMA262.
8285

83-
#### `code.isIdentifierPart(code)`
86+
### `code.isIdentifierPart(code)`
8487

85-
Return `true` if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262.
88+
Return `true` if provided code can be the trailing character of ECMA262 `Identifier`.
89+
They are formally defined in ECMA262.
8690

87-
### `keyword`
91+
## `keyword`
8892

89-
#### `keyword.isKeywordES5(id, strict)`
93+
### `keyword.isKeywordES5(id, strict)`
9094

9195
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
92-
in ECMA262 edition 5.1. They are formally defined in ECMA262 sections
96+
in ECMA262 edition 5.1.
97+
They are formally defined in ECMA262 sections
9398
[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2),
94-
respectively. If the `strict` flag is truthy, this function additionally checks whether
95-
`id` is a Keyword or Future Reserved Word under strict mode.
99+
respectively.
100+
If the `strict` flag is truthy, this function additionally checks whether
101+
`id` is a `Keyword` or `FutureReservedWord` under strict mode.
96102

97-
#### `keyword.isKeywordES6(id, strict)`
103+
### `keyword.isKeywordES6(id, strict)`
98104

99-
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
100-
in ECMA262 edition 6. They are formally defined in ECMA262 sections
105+
Returns `true` if provided identifier string is a `Keyword` or `FutureReservedWord`
106+
in ECMA262 edition 6.
107+
They are formally defined in ECMA262 sections
101108
[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and
102109
[11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words),
103-
respectively. If the `strict` flag is truthy, this function additionally checks whether
104-
`id` is a Keyword or Future Reserved Word under strict mode.
110+
respectively.
111+
If the `strict` flag is truthy, this function additionally checks whether
112+
`id` is a `Keyword` or `FutureReservedWord` under strict mode.
105113

106-
#### `keyword.isReservedWordES5(id, strict)`
114+
### `keyword.isReservedWordES5(id, strict)`
107115

108-
Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1.
116+
Returns `true` if provided identifier string is a `ReservedWord` in ECMA262 edition 5.1.
109117
They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1).
110118
If the `strict` flag is truthy, this function additionally checks whether `id`
111-
is a Reserved Word under strict mode.
119+
is a `ReservedWord` under strict mode.
112120

113-
#### `keyword.isReservedWordES6(id, strict)`
121+
### `keyword.isReservedWordES6(id, strict)`
114122

115-
Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6.
123+
Returns `true` if provided identifier string is a `ReservedWord` in ECMA262 edition 6.
116124
They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words).
117125
If the `strict` flag is truthy, this function additionally checks whether `id`
118-
is a Reserved Word under strict mode.
126+
is a `ReservedWord` under strict mode.
119127

120-
#### `keyword.isRestrictedWord(id)`
128+
### `keyword.isRestrictedWord(id)`
121129

122130
Returns `true` if provided identifier string is one of `eval` or `arguments`.
123131
They are restricted in strict mode code throughout ECMA262 edition 5.1 and
124132
in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors).
125133

126-
#### `keyword.isIdentifierNameES5(id)`
134+
### `keyword.isIdentifierNameES5(id)`
127135

128-
Return `true` if provided identifier string is an IdentifierName as specified in
136+
Return `true` if provided identifier string is an `IdentifierName` as specified in
129137
ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6).
130138

131-
#### `keyword.isIdentifierNameES6(id)`
139+
### `keyword.isIdentifierNameES6(id)`
132140

133-
Return `true` if provided identifier string is an IdentifierName as specified in
141+
Return `true` if provided identifier string is an `IdentifierName` as specified in
134142
ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords).
135143

136-
#### `keyword.isIdentifierES5(id, strict)`
144+
### `keyword.isIdentifierES5(id, strict)`
137145

138-
Return `true` if provided identifier string is an Identifier as specified in
139-
ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict`
140-
flag is truthy, this function additionally checks whether `id` is an Identifier
141-
under strict mode.
146+
Return `true` if provided identifier string is an `Identifier` as specified in
147+
ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6).
148+
If the `strict` flag is truthy, this function additionally checks whether `id`
149+
is an `Identifier` under strict mode.
142150

143-
#### `keyword.isIdentifierES6(id, strict)`
151+
### `keyword.isIdentifierES6(id, strict)`
144152

145-
Return `true` if provided identifier string is an Identifier as specified in
153+
Return `true` if provided identifier string is an `Identifier` as specified in
146154
ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers).
147155
If the `strict` flag is truthy, this function additionally checks whether `id`
148-
is an Identifier under strict mode.
156+
is an `Identifier` under strict mode.
149157

150-
### License
158+
## License
151159

152160
Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation)
153161
(twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.

0 commit comments

Comments
 (0)