High-level intermediate representation for a regular expression. #
A high-level intermediate representation Syntax.Hir for a regular expression.
see UInt32.isValidChar
Instances For
Instances For
Instances For
- Unicode : ClassUnicode → Class
A set of characters represented by Unicode scalar values.
Instances For
The high-level intermediate representation for a look-around assertion.
- Start : Look
Match the beginning of text.
- End : Look
Match the end of text.
- EndWithOptionalLF : Look
Match the end of text (before optional newline).
- StartLF : Look
Match the beginning of a line or the beginning of text.
- EndLF : Look
Match the end of a line or the end of text.
- StartCRLF : Look
Match the beginning of a line or the beginning of text.
- EndCRLF : Look
Match the end of a line or the end of text.
- WordUnicode : Look
Match a Unicode-aware word boundary.
- WordUnicodeNegate : Look
Match a Unicode-aware negation of a word boundary.
- WordStartUnicode : Look
Match the start of a Unicode word boundary.
- WordEndUnicode : Look
Match the end of a Unicode word boundary.
- WordStartHalfUnicode : Look
Match the start half of a Unicode word boundary.
- WordEndHalfUnicode : Look
Match the end half of a Unicode word boundary.
- PreviousMatch : Look
Match the end of the previous match or start of string.
- ClearMatches : Look
Clear all matches.
Instances For
A translator's representation of a regular expression's flags at any given moment in time.
- extended : Option Grammar.ExtendedKind
Instances For
The high-level intermediate representation for a look-around assertion.
- PositiveLookahead : Hir → Lookaround
- NegativeLookahead : Hir → Lookaround
- PositiveLookbehind : Nat → Hir → Lookaround
- NegativeLookbehind : Nat → Hir → Lookaround
Instances For
A concatenation of regular expressions.
Instances For
- mk (fst snd : Hir) (tail : Array Hir) : Alternation
Instances For
The underlying kind of an arbitrary [Hir] expression.
- Empty : HirKind
The empty regular expression, which matches everything, including the empty string.
- Literal : Char → HirKind
A literal string that matches exactly these bytes.
- BackRef : Bool → Nat → HirKind
A backrefence to a capturung group.
- Class : Syntax.Class → HirKind
A single character class that matches any of the characters in the class.
- Look : Syntax.Look → HirKind
A look-around assertion. A look-around match always has zero length.
- Lookaround : Syntax.Lookaround → HirKind
A complex look-around assertion.
- Repetition : Syntax.Repetition → HirKind
A repetition operation applied to a sub-expression.
- Capture : Syntax.Capture → HirKind
A capturing group, which contains a sub-expression.
- Concat : Array Hir → HirKind
A concatenation of expressions.
- Alternation : Syntax.Alternation → HirKind
An alternation of expressions.
Instances For
A high-level intermediate representation (HIR) for a regular expression.
- mk (kind : HirKind) (props : Properties) : Hir
Instances For
check if an hir contains .Lookaround
Instances For
A type describing the different flavors of ..
- AnyChar : Dot
Matches the UTF-8 encoding of any Unicode scalar value. This is equivalent to
(?su:.)and also\p{any}. - AnyCharExceptLF : Dot
Matches the UTF-8 encoding of any Unicode scalar value except for
\n. This is equivalent to(?u-s:.)and also[\p{any}--\n]. - AnyCharExceptCRLF : Dot
Matches the UTF-8 encoding of any Unicode scalar value except for
\rand\n. This is equivalent to(?uR-s:.)and also[\p{any}--\r\n].
Instances For
An HirFrame is a single stack frame, represented explicitly, which is created for each item in the Ast that we traverse.
- Expr : Hir → HirFrame
- Literal : Char → HirFrame
- BackRef : Bool → Nat → HirFrame
- ClassUnicode : Syntax.ClassUnicode → HirFrame
- Repetition : HirFrame
- Group (old_flags : Flags) : HirFrame
- Concat : HirFrame
- Alternation : HirFrame
Instances For
Assert that the current stack frame is a Unicode class expression and return it.