Skip to content

Commit

Permalink
Add note about missing character for position.end
Browse files Browse the repository at this point in the history
Closes GH-20.
  • Loading branch information
wooorm committed Aug 31, 2018
1 parent 51c8adb commit 5565ad1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ interface Position {
The `start` field of **Position** represents the place of the first character
of the parsed source region.
The `end` field of **Position** represents the place of the first character
after the parsed source region.
after the parsed source region, whether it exists or not.
The value of the `start` and `end` fields implement the [**Point**][dfn-point]
interface.

Expand All @@ -143,6 +143,20 @@ If the syntactic unit represented by a node is not present in the source
[_file_][term-file] at the time of parsing, the node is said to be
[_generated_][term-generated] and it must not have positional information.

For example, if the following value was represented as unist:

```markdown
alpha
bravo
```

…the first word (`alpha`) would start at line `1`, column `1`, offset `0`, and
end at line `1`, column `6`, offset `5`.
The line feed would start at line `1`, column `6`, offset `5`, and end at line
`2`, column `1`, offset `6`.
The last word (`bravo`) would start at line `2`, column `1`, offset `6`, and
end at line `2`, column `6`, offset `11`.

#### `Point`

```idl
Expand Down

0 comments on commit 5565ad1

Please sign in to comment.