pomsky_syntax/exprs/
regex.rs1use crate::Span;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
5pub struct Regex {
6 pub content: String,
7 pub span: Span,
8}
9
10impl Regex {
11 pub(crate) fn new(content: String, span: Span) -> Self {
12 Regex { content, span }
13 }
14
15 #[cfg(feature = "dbg")]
16 pub(super) fn pretty_print(&self, buf: &mut crate::PrettyPrinter) {
17 buf.push_str("regex ");
18 write!(buf, "{:?}", self.content);
19 }
20}