| OLD | NEW |
| 1 Parsing | 1 Parsing |
| 2 ======= | 2 ======= |
| 3 | 3 |
| 4 Parsing in Sky is a strict pipeline consisting of five stages: | 4 Parsing in Sky is a strict pipeline consisting of five stages: |
| 5 | 5 |
| 6 - decoding, which converts incoming bytes into Unicode characters | 6 - decoding, which converts incoming bytes into Unicode characters |
| 7 using UTF-8. | 7 using UTF-8. |
| 8 | 8 |
| 9 - normalising, which manipulates the sequence of characters. | 9 - normalising, which manipulates the sequence of characters. |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 Later stages cannot affect earlier stages. | 21 Later stages cannot affect earlier stages. |
| 22 | 22 |
| 23 When a sequence of bytes is to be parsed, there is always a defined | 23 When a sequence of bytes is to be parsed, there is always a defined |
| 24 _parsing context_, which is either an Application object or a Module | 24 _parsing context_, which is either an Application object or a Module |
| 25 object. | 25 object. |
| 26 | 26 |
| 27 | 27 |
| 28 Decoding stage | 28 Decoding stage |
| 29 -------------- | 29 -------------- |
| 30 | 30 |
| 31 To decode a sequence of bytes _bytes_ for parsing, the [UTF-8 | 31 To decode a sequence of bytes _bytes_ for parsing, the [utf-8 |
| 32 decoder](https://encoding.spec.whatwg.org/#utf-8-decoder) must be used | 32 decode](https://encoding.spec.whatwg.org/#utf-8-decode) algorithm must |
| 33 to transform _bytes_ into a sequence of characters _characters_. | 33 be used to transform _bytes_ into a sequence of characters |
| 34 _characters_. |
| 35 |
| 36 Note: The decoder will strip a leading BOM if any. |
| 34 | 37 |
| 35 This sequence must then be passed to the normalisation stage. | 38 This sequence must then be passed to the normalisation stage. |
| 36 | 39 |
| 37 | 40 |
| 38 Normalisation stage | 41 Normalisation stage |
| 39 ------------------- | 42 ------------------- |
| 40 | 43 |
| 41 To normalise a sequence of characters, apply the following rules: | 44 To normalise a sequence of characters, apply the following rules: |
| 42 | 45 |
| 43 * Any U+000D character followed by a U+000A character must be removed. | 46 * Any U+000D character followed by a U+000A character must be removed. |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 there isn't one, skip this token. | 809 there isn't one, skip this token. |
| 807 2. If there's a ``template`` element in the _stack of open | 810 2. If there's a ``template`` element in the _stack of open |
| 808 nodes_ above _node_, then skip this token. | 811 nodes_ above _node_, then skip this token. |
| 809 3. Pop nodes from the _stack of open nodes_ until _node_ has been | 812 3. Pop nodes from the _stack of open nodes_ until _node_ has been |
| 810 popped. | 813 popped. |
| 811 4. If _node_'s tag name is ``script``, then yield until there | 814 4. If _node_'s tag name is ``script``, then yield until there |
| 812 are no pending import loads, then execute the script given by | 815 are no pending import loads, then execute the script given by |
| 813 the element's contents. | 816 the element's contents. |
| 814 3. Yield until there are no pending import loads. | 817 3. Yield until there are no pending import loads. |
| 815 3. Fire a ``load`` event at the _parsing context_ object. | 818 3. Fire a ``load`` event at the _parsing context_ object. |
| OLD | NEW |