-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(parser): improve grammar (#1081)
avoid failling into the `AnyChar` rule when parsing content with the `NormalGroup` entrypoint includes refactoring of the `InlineWord` and `Punctuation` rules to match content faster. Signed-off-by: Xavier Coulon <[email protected]>
- Loading branch information
Showing
16 changed files
with
42,956 additions
and
70,307 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
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
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 |
---|---|---|
|
@@ -200,7 +200,7 @@ a link to <{example}>.` | |
Expect(ParseDocument(source)).To(MatchDocument(expected)) | ||
}) | ||
|
||
It("with special character in URL", func() { | ||
It("with invalid special character in URL", func() { | ||
source := `a link to https://example.com>[].` | ||
expected := &types.Document{ | ||
Elements: []interface{}{ | ||
|
@@ -212,11 +212,14 @@ a link to <{example}>.` | |
&types.InlineLink{ | ||
Location: &types.Location{ | ||
Scheme: "https://", | ||
Path: "example.com>", | ||
Path: "example.com", | ||
}, | ||
}, | ||
&types.SpecialCharacter{ | ||
Name: ">", | ||
}, | ||
&types.StringElement{ | ||
Content: ".", | ||
Content: "[].", | ||
}, | ||
}, | ||
}, | ||
|
@@ -289,16 +292,7 @@ a link to <{example}>.` | |
&types.Paragraph{ | ||
Elements: []interface{}{ | ||
&types.StringElement{ | ||
Content: "write to ", | ||
}, | ||
&types.InlineLink{ | ||
Location: &types.Location{ | ||
Scheme: "mailto:", | ||
Path: "[email protected]", | ||
}, | ||
}, | ||
&types.StringElement{ | ||
Content: ".", | ||
Content: "write to [email protected].", // local part must not end with `.` | ||
}, | ||
}, | ||
}, | ||
|
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
Oops, something went wrong.