summaryrefslogtreecommitdiff
path: root/src/syntax/expr.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-07-29 17:46:57 +0200
committerGitHub <noreply@github.com>2020-07-29 17:46:57 +0200
commitf34ba3dcda182d9b9c14cc94fdb48810bf18bef0 (patch)
tree667a7aba2f26996c7ada8ce85952c384a1dbd5a1 /src/syntax/expr.rs
parente7ffdde43d09f60238590723c2829554806e23d5 (diff)
parent9672d4320052d08b67d497febed4a0ad78bf9252 (diff)
Merge pull request #7 from typst/parser-update
Parser update
Diffstat (limited to 'src/syntax/expr.rs')
-rw-r--r--src/syntax/expr.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs
index a27bdb62..a1b3fd62 100644
--- a/src/syntax/expr.rs
+++ b/src/syntax/expr.rs
@@ -93,9 +93,6 @@ impl Debug for Expr {
/// A unicode identifier.
///
-/// The identifier must be valid! This is checked in [`Ident::new`] or
-/// [`is_identifier`].
-///
/// # Example
/// ```typst
/// [func: "hi", ident]
@@ -105,7 +102,8 @@ impl Debug for Expr {
pub struct Ident(pub String);
impl Ident {
- /// Create a new identifier from a string checking that it is valid.
+ /// Create a new identifier from a string checking that it is a valid
+ /// unicode identifier.
pub fn new<S>(ident: S) -> Option<Ident> where S: AsRef<str> + Into<String> {
if is_identifier(ident.as_ref()) {
Some(Ident(ident.into()))