mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-14 16:45:07 +01:00
pretty arrow
This commit is contained in:
parent
56974cf077
commit
91f4b397a2
2 changed files with 41 additions and 0 deletions
|
|
@ -349,6 +349,8 @@ where
|
|||
(b'.', Some(b'.'), Some(b'.')) => triple_punct!(self, DotDotDot),
|
||||
(b'<', Some(b'<'), Some(b'=')) => triple_punct!(self, LeftLeftChevronEq),
|
||||
(b'>', Some(b'>'), Some(b'=')) => triple_punct!(self, RightRightChevronEq),
|
||||
// the pretty pretty unicode arrow → is obviously supported here, i hope this won't cause probelms
|
||||
(b'\xE2', Some(b'\x86'), Some(b'\x92')) => triple_punct!(self, Arrow),
|
||||
// DOUBLE CHARACTER PUNCTUATION
|
||||
(b'<', Some(b':'), _) => double_punct!(self, BracketOpen),
|
||||
(b':', Some(b'>'), _) => double_punct!(self, BracketClose),
|
||||
|
|
@ -457,4 +459,13 @@ int hello(const char* uwu) <%
|
|||
|
||||
lex_test!(src);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pretty_arrow() {
|
||||
let src = r#"
|
||||
struct_ptr→field;
|
||||
"#;
|
||||
|
||||
lex_test!(src);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
source: parser/src/pre/lexer.rs
|
||||
expression: tokens
|
||||
---
|
||||
[
|
||||
(
|
||||
Identifier(
|
||||
"struct_ptr",
|
||||
),
|
||||
1..11,
|
||||
),
|
||||
(
|
||||
Punctuator(
|
||||
Arrow,
|
||||
),
|
||||
11..14,
|
||||
),
|
||||
(
|
||||
Identifier(
|
||||
"field",
|
||||
),
|
||||
14..19,
|
||||
),
|
||||
(
|
||||
Punctuator(
|
||||
Semicolon,
|
||||
),
|
||||
19..20,
|
||||
),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue