diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-02-03 21:30:36 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-02-03 21:34:49 +0100 |
| commit | d86a5e8a1f469dd79abf3137dba77a71fae2a774 (patch) | |
| tree | fc7ab35d999322b9d124e41ab80948df23965d26 /src/syntax/ident.rs | |
| parent | 6fcef9973be4253e5b377251dd9d1921f9738fc1 (diff) | |
Tidy up raw blocks 🧹
- Better trimming (only trim at the end if necessary)
- Fixed block-level layouting
- Improved pretty printing
- Flip inline variable to block
- Flip inline variable to display for math formulas
Diffstat (limited to 'src/syntax/ident.rs')
| -rw-r--r-- | src/syntax/ident.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/syntax/ident.rs b/src/syntax/ident.rs index 3cb47c47..c4cc19bc 100644 --- a/src/syntax/ident.rs +++ b/src/syntax/ident.rs @@ -2,6 +2,8 @@ use std::ops::Deref; use unicode_xid::UnicodeXID; +use crate::pretty::{Pretty, Printer}; + /// An Unicode identifier with a few extra permissible characters. /// /// In addition to what is specified in the [Unicode Standard][uax31], we allow: @@ -28,6 +30,12 @@ impl Ident { } } +impl Pretty for Ident { + fn pretty(&self, p: &mut Printer) { + p.push_str(self.as_str()); + } +} + impl AsRef<str> for Ident { fn as_ref(&self) -> &str { self |
