summaryrefslogtreecommitdiff
path: root/src/syntax/parsing.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-31 14:53:21 +0200
committerGitHub <noreply@github.com>2020-08-31 14:53:21 +0200
commit798c8a10c861c6185f1fdee3b0ce3c46dcd96700 (patch)
tree30d90f46dfcdf855335f6feb07305cd5b9c2baf7 /src/syntax/parsing.rs
parent696560622d52e0e8c7a09df4851d25f9ea022899 (diff)
parent1942a25793ce11c2854deed8d1dcd56ae851e1d6 (diff)
Merge pull request #14 from typst/non-breaking-space
Non-breaking spaces
Diffstat (limited to 'src/syntax/parsing.rs')
-rw-r--r--src/syntax/parsing.rs26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/syntax/parsing.rs b/src/syntax/parsing.rs
index ae9cfdb1..6a8b8103 100644
--- a/src/syntax/parsing.rs
+++ b/src/syntax/parsing.rs
@@ -1001,18 +1001,20 @@ mod tests {
#[test]
fn test_parse_simple_nodes() {
- t!("" => );
- t!("hi" => T("hi"));
- t!("*hi" => B, T("hi"));
- t!("hi_" => T("hi"), I);
- t!("hi you" => T("hi"), S, T("you"));
- t!("\\u{1f303}" => T("🌃"));
- t!("\n\n\nhello" => P, T("hello"));
- t!(r"a\ b" => T("a"), L, S, T("b"));
- t!("`py`" => R!["py"]);
- t!("`hi\nyou" => R!["hi", "you"]);
- e!("`hi\nyou" => s(1,3, 1,3, "expected backtick"));
- t!("`hi\\`du`" => R!["hi`du"]);
+ t!("" => );
+ t!("hi" => T("hi"));
+ t!("*hi" => B, T("hi"));
+ t!("hi_" => T("hi"), I);
+ t!("hi you" => T("hi"), S, T("you"));
+ t!("special~name" => T("special"), T("\u{00A0}"), T("name"));
+ t!("special\\~name" => T("special"), T("~"), T("name"));
+ t!("\\u{1f303}" => T("🌃"));
+ t!("\n\n\nhello" => P, T("hello"));
+ t!(r"a\ b" => T("a"), L, S, T("b"));
+ t!("`py`" => R!["py"]);
+ t!("`hi\nyou" => R!["hi", "you"]);
+ e!("`hi\nyou" => s(1,3, 1,3, "expected backtick"));
+ t!("`hi\\`du`" => R!["hi`du"]);
t!("```java System.out.print```" => C![Some("java"), "System.out.print"]);
t!("``` console.log(\n\"alert\"\n)" => C![None, "console.log(", "\"alert\"", ")"]);