typst_syntax

Function is_ident

source
pub fn is_ident(string: &str) -> bool
Expand description

Whether a string is a valid Typst identifier.

In addition to what is specified in the Unicode Standard, we allow:

  • _ as a starting character,
  • _ and - as continuing characters.