-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #30 - behnam:rule-l1, r=mbrubeck
Add Conformance Test and implement L1 rule Initial results: `60494 test cases failed! (196253 passed)` Because of the current limitations of rust's test framework, and the huge number of failures, the base (not including matching pairs) conformance test is executed in one run, and a summary is panic'ed (if there's any failure) and for the integration test to pass, it's marked as `should_panic`, with summary of the test run as `expected` string. Fix #1 To be able to implement L1, we need access to more information from `BidiInfo`, namely `original_classes` of the `text`, in `visual_runs()`, which would mean it should pass through `reorder_line()`. The fact that information from `BidiInfo` is needed for both steps of the public API (generating `BidiInfo` and consuming it per-paragraph/per-level) made me change the API design and move these methods into `impl BidiInfo`. Then, since we needed access to `text` for every `BidiInfo` consumption, I added a reference to `text` to `BidiInfo`, which also enables more compile-time checks for `BidiInfo` isntance not outliving the text in the user code. NOTE: We are already breaking API in version 0.3.0 and paving for full spec support is a good reason to do so, IMHO. The L1 rule works by one pass on the text of the line. Conformance Test: this implementation reduces the number of failures from 60494 to 23770 (out of total 256747 cases). Fix #2 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/unicode-bidi/30) <!-- Reviewable:end -->
- Loading branch information
Showing
12 changed files
with
595,204 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
This software was written by the following people: | ||
|
||
Matt Brubeck <mbrubeck@limpet.net> | ||
Behnam Esfahbod <behnam@zwnj.org> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2014 The html5ever Project Developers. See the | ||
// COPYRIGHT file at the top-level directory of this distribution. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//! Directional Formatting Characters | ||
//! | ||
//! http://www.unicode.org/reports/tr9/#Directional_Formatting_Characters | ||
|
||
// == Implicit == | ||
/// ARABIC LETTER MARK | ||
pub const ALM: char = '\u{061C}'; | ||
/// LEFT-TO-RIGHT MARK | ||
pub const LRM: char = '\u{200E}'; | ||
/// RIGHT-TO-LEFT MARK | ||
pub const RLM: char = '\u{200F}'; | ||
|
||
// == Explicit Isolates == | ||
/// LEFT‑TO‑RIGHT ISOLATE | ||
pub const LRI: char = '\u{2066}'; | ||
/// RIGHT‑TO‑LEFT ISOLATE | ||
pub const RLI: char = '\u{2067}'; | ||
/// FIRST STRONG ISOLATE | ||
pub const FSI: char = '\u{2068}'; | ||
/// POP DIRECTIONAL ISOLATE | ||
pub const PDI: char = '\u{2069}'; | ||
|
||
// == Explicit Embeddings and Overrides == | ||
/// LEFT-TO-RIGHT EMBEDDING | ||
pub const LRE: char = '\u{202A}'; | ||
/// RIGHT-TO-LEFT EMBEDDING | ||
pub const RLE: char = '\u{202B}'; | ||
/// LEFT-TO-RIGHT OVERRIDE | ||
pub const LRO: char = '\u{202D}'; | ||
/// RIGHT-TO-LEFT OVERRIDE | ||
pub const RLO: char = '\u{202E}'; | ||
/// POP DIRECTIONAL FORMATTING | ||
pub const PDF: char = '\u{202C}'; |
Oops, something went wrong.