Skip to content

Commit

Permalink
pattern length, pattern count and pattern offset done
Browse files Browse the repository at this point in the history
  • Loading branch information
TommYDeeee committed Mar 25, 2024
1 parent dbf3710 commit e52430e
Show file tree
Hide file tree
Showing 15 changed files with 507 additions and 12 deletions.
12 changes: 12 additions & 0 deletions src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ pub(crate) enum LogosToken {
// Variables
#[regex(r"\$_?[a-zA-Z][a-zA-Z0-9_]*", |lex| lex.slice().to_string())]
Variable(String),
// Variables
#[regex(r"#_?[a-zA-Z][a-zA-Z0-9_]*", |lex| lex.slice().to_string())]
VariableCount(String),
// Variables
#[regex(r"@_?[a-zA-Z][a-zA-Z0-9_]*", |lex| lex.slice().to_string())]
VariableOffset(String),
// Variables
#[regex(r"!_?[a-zA-Z][a-zA-Z0-9_]*", |lex| lex.slice().to_string())]
VariableLength(String),
// Integer
#[regex(r"0x[a-fA-F0-9]+|0o[0-7]+|[0-9]+(KB|MB)?", |lex| lex.slice().to_string())]
Integer(String),
Expand Down Expand Up @@ -307,6 +316,9 @@ fn logos_tokenkind_to_syntaxkind(token: LogosToken) -> SyntaxKind {
LogosToken::Them => SyntaxKind::THEM_KW,
LogosToken::Identifier(_) => SyntaxKind::IDENTIFIER,
LogosToken::Variable(_) => SyntaxKind::VARIABLE,
LogosToken::VariableCount(_) => SyntaxKind::VARIABLE_COUNT,
LogosToken::VariableOffset(_) => SyntaxKind::VARIABLE_OFFSET,
LogosToken::VariableLength(_) => SyntaxKind::VARIABLE_LENGTH,
LogosToken::String(_) => SyntaxKind::STRING_LIT,
LogosToken::Ascii => SyntaxKind::ASCII_KW,
LogosToken::Wide => SyntaxKind::WIDE_KW,
Expand Down
47 changes: 47 additions & 0 deletions src/parser/grammar/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,15 @@ fn primary_expr(p: &mut Parser) -> Option<CompletedMarker> {
T![string_lit] => {
p.bump(T![string_lit]);
}
T![variable_count] => {
variable_count(p);
}
T![variable_offset] => {
variable_offset(p);
}
T![variable_length] => {
variable_length(p);
}
T![filesize] => {
p.bump(T![filesize]);
}
Expand Down Expand Up @@ -608,6 +617,44 @@ fn primary_expr(p: &mut Parser) -> Option<CompletedMarker> {
Some(cm)
}

fn variable_count(p: &mut Parser) {
let m = p.start();
p.bump(T![variable_count]);
if p.at(T![in]) {
let n = p.start();
p.bump(T![in]);
range(p);
n.complete(p, IN_RANGE);
}
m.complete(p, VARIABLE_COUNT);
}

fn variable_offset(p: &mut Parser) {
let m = p.start();
p.bump(T![variable_offset]);
if p.at(T!['[']) {
let n = p.start();
p.bump(T!['[']);
expr(p, None, 1);
p.expect(T![']']);
n.complete(p, EXPR_INDEX);
}
m.complete(p, VARIABLE_OFFSET);
}

fn variable_length(p: &mut Parser) {
let m = p.start();
p.bump(T![variable_length]);
if p.at(T!['[']) {
let n = p.start();
p.bump(T!['[']);
expr(p, None, 1);
p.expect(T![']']);
n.complete(p, EXPR_INDEX);
}
m.complete(p, VARIABLE_LENGTH);
}

fn range(p: &mut Parser) {
let m = p.start();
p.expect(T!['(']);
Expand Down
7 changes: 6 additions & 1 deletion src/parser/syntax_kind/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ pub enum SyntaxKind {
REGEX_LIT,
IDENTIFIER,
VARIABLE,
VARIABLE_COUNT,
VARIABLE_OFFSET,
VARIABLE_LENGTH,
WHITESPACE,
COMMENT,
CASE_INSENSITIVE,
Expand Down Expand Up @@ -134,6 +137,8 @@ pub enum SyntaxKind {
ITERABLE,
INDEXING_EXPR,
FUNCTION_CALL_EXPR,
IN_RANGE,
EXPR_INDEX,
#[doc(hidden)]
__LAST,
}
Expand Down Expand Up @@ -291,5 +296,5 @@ impl SyntaxKind {
}
}
#[macro_export]
macro_rules ! T { [:] => { $ crate :: SyntaxKind :: COLON } ; ['('] => { $ crate :: SyntaxKind :: L_PAREN } ; [')'] => { $ crate :: SyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: SyntaxKind :: L_BRACE } ; ['}'] => { $ crate :: SyntaxKind :: R_BRACE } ; ['['] => { $ crate :: SyntaxKind :: L_BRACKET } ; [']'] => { $ crate :: SyntaxKind :: R_BRACKET } ; [,] => { $ crate :: SyntaxKind :: COMMA } ; [=] => { $ crate :: SyntaxKind :: ASSIGN } ; [-] => { $ crate :: SyntaxKind :: HYPHEN } ; [?] => { $ crate :: SyntaxKind :: QUESTION_MARK } ; [~] => { $ crate :: SyntaxKind :: TILDE } ; [|] => { $ crate :: SyntaxKind :: PIPE } ; [/] => { $ crate :: SyntaxKind :: SLASH } ; [+] => { $ crate :: SyntaxKind :: PLUS } ; [*] => { $ crate :: SyntaxKind :: STAR } ; [%] => { $ crate :: SyntaxKind :: PERCENTAGE } ; [<<] => { $ crate :: SyntaxKind :: SHL } ; [>>] => { $ crate :: SyntaxKind :: SHR } ; [&] => { $ crate :: SyntaxKind :: AMPERSAND } ; [^] => { $ crate :: SyntaxKind :: CARET } ; [.] => { $ crate :: SyntaxKind :: DOT } ; [==] => { $ crate :: SyntaxKind :: EQ } ; [!=] => { $ crate :: SyntaxKind :: NE } ; [<] => { $ crate :: SyntaxKind :: LT } ; [<=] => { $ crate :: SyntaxKind :: LE } ; [>] => { $ crate :: SyntaxKind :: GT } ; [>=] => { $ crate :: SyntaxKind :: GE } ; [..] => { $ crate :: SyntaxKind :: DOTDOT } ; [and] => { $ crate :: SyntaxKind :: AND_KW } ; [or] => { $ crate :: SyntaxKind :: OR_KW } ; [not] => { $ crate :: SyntaxKind :: NOT_KW } ; [rule] => { $ crate :: SyntaxKind :: RULE_KW } ; [strings] => { $ crate :: SyntaxKind :: STRINGS_KW } ; [condition] => { $ crate :: SyntaxKind :: CONDITION_KW } ; [meta] => { $ crate :: SyntaxKind :: META_KW } ; [private] => { $ crate :: SyntaxKind :: PRIVATE_KW } ; [global] => { $ crate :: SyntaxKind :: GLOBAL_KW } ; [import] => { $ crate :: SyntaxKind :: IMPORT_KW } ; [include] => { $ crate :: SyntaxKind :: INCLUDE_KW } ; [ascii] => { $ crate :: SyntaxKind :: ASCII_KW } ; [wide] => { $ crate :: SyntaxKind :: WIDE_KW } ; [nocase] => { $ crate :: SyntaxKind :: NOCASE_KW } ; [fullword] => { $ crate :: SyntaxKind :: FULLWORD_KW } ; [xor] => { $ crate :: SyntaxKind :: XOR_KW } ; [base64] => { $ crate :: SyntaxKind :: BASE64_KW } ; [base64wide] => { $ crate :: SyntaxKind :: BASE64WIDE_KW } ; [contains] => { $ crate :: SyntaxKind :: CONTAINS_KW } ; [icontains] => { $ crate :: SyntaxKind :: ICONTAINS_KW } ; [startswith] => { $ crate :: SyntaxKind :: STARTSWITH_KW } ; [istartswith] => { $ crate :: SyntaxKind :: ISTARTSWITH_KW } ; [endswith] => { $ crate :: SyntaxKind :: ENDSWITH_KW } ; [iendswith] => { $ crate :: SyntaxKind :: IENDSWITH_KW } ; [iequals] => { $ crate :: SyntaxKind :: IEQUALS_KW } ; [matches] => { $ crate :: SyntaxKind :: MATCHES_KW } ; [defined] => { $ crate :: SyntaxKind :: DEFINED_KW } ; [filesize] => { $ crate :: SyntaxKind :: FILESIZE_KW } ; [entrypoint] => { $ crate :: SyntaxKind :: ENTRYPOINT_KW } ; [at] => { $ crate :: SyntaxKind :: AT_KW } ; [in] => { $ crate :: SyntaxKind :: IN_KW } ; [of] => { $ crate :: SyntaxKind :: OF_KW } ; [them] => { $ crate :: SyntaxKind :: THEM_KW } ; [all] => { $ crate :: SyntaxKind :: ALL_KW } ; [any] => { $ crate :: SyntaxKind :: ANY_KW } ; [none] => { $ crate :: SyntaxKind :: NONE_KW } ; [for] => { $ crate :: SyntaxKind :: FOR_KW } ; [identifier] => { $ crate :: SyntaxKind :: IDENTIFIER } ; [variable] => { $ crate :: SyntaxKind :: VARIABLE } ; [string_lit] => { $ crate :: SyntaxKind :: STRING_LIT } ; [int_lit] => { $ crate :: SyntaxKind :: INT_LIT } ; [float_lit] => { $ crate :: SyntaxKind :: FLOAT_LIT } ; [bool_lit] => { $ crate :: SyntaxKind :: BOOL_LIT } ; [hex_lit] => { $ crate :: SyntaxKind :: HEX_LIT } ; [regex_lit] => { $ crate :: SyntaxKind :: REGEX_LIT } ; [dot_matches_all] => { $ crate :: SyntaxKind :: DOT_MATCHES_ALL } ; [case_insensitive] => { $ crate :: SyntaxKind :: CASE_INSENSITIVE } ; [backslash] => { $ crate :: SyntaxKind :: BACKSLASH } ; }
macro_rules ! T { [:] => { $ crate :: SyntaxKind :: COLON } ; ['('] => { $ crate :: SyntaxKind :: L_PAREN } ; [')'] => { $ crate :: SyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: SyntaxKind :: L_BRACE } ; ['}'] => { $ crate :: SyntaxKind :: R_BRACE } ; ['['] => { $ crate :: SyntaxKind :: L_BRACKET } ; [']'] => { $ crate :: SyntaxKind :: R_BRACKET } ; [,] => { $ crate :: SyntaxKind :: COMMA } ; [=] => { $ crate :: SyntaxKind :: ASSIGN } ; [-] => { $ crate :: SyntaxKind :: HYPHEN } ; [?] => { $ crate :: SyntaxKind :: QUESTION_MARK } ; [~] => { $ crate :: SyntaxKind :: TILDE } ; [|] => { $ crate :: SyntaxKind :: PIPE } ; [/] => { $ crate :: SyntaxKind :: SLASH } ; [+] => { $ crate :: SyntaxKind :: PLUS } ; [*] => { $ crate :: SyntaxKind :: STAR } ; [%] => { $ crate :: SyntaxKind :: PERCENTAGE } ; [<<] => { $ crate :: SyntaxKind :: SHL } ; [>>] => { $ crate :: SyntaxKind :: SHR } ; [&] => { $ crate :: SyntaxKind :: AMPERSAND } ; [^] => { $ crate :: SyntaxKind :: CARET } ; [.] => { $ crate :: SyntaxKind :: DOT } ; [==] => { $ crate :: SyntaxKind :: EQ } ; [!=] => { $ crate :: SyntaxKind :: NE } ; [<] => { $ crate :: SyntaxKind :: LT } ; [<=] => { $ crate :: SyntaxKind :: LE } ; [>] => { $ crate :: SyntaxKind :: GT } ; [>=] => { $ crate :: SyntaxKind :: GE } ; [..] => { $ crate :: SyntaxKind :: DOTDOT } ; [and] => { $ crate :: SyntaxKind :: AND_KW } ; [or] => { $ crate :: SyntaxKind :: OR_KW } ; [not] => { $ crate :: SyntaxKind :: NOT_KW } ; [rule] => { $ crate :: SyntaxKind :: RULE_KW } ; [strings] => { $ crate :: SyntaxKind :: STRINGS_KW } ; [condition] => { $ crate :: SyntaxKind :: CONDITION_KW } ; [meta] => { $ crate :: SyntaxKind :: META_KW } ; [private] => { $ crate :: SyntaxKind :: PRIVATE_KW } ; [global] => { $ crate :: SyntaxKind :: GLOBAL_KW } ; [import] => { $ crate :: SyntaxKind :: IMPORT_KW } ; [include] => { $ crate :: SyntaxKind :: INCLUDE_KW } ; [ascii] => { $ crate :: SyntaxKind :: ASCII_KW } ; [wide] => { $ crate :: SyntaxKind :: WIDE_KW } ; [nocase] => { $ crate :: SyntaxKind :: NOCASE_KW } ; [fullword] => { $ crate :: SyntaxKind :: FULLWORD_KW } ; [xor] => { $ crate :: SyntaxKind :: XOR_KW } ; [base64] => { $ crate :: SyntaxKind :: BASE64_KW } ; [base64wide] => { $ crate :: SyntaxKind :: BASE64WIDE_KW } ; [contains] => { $ crate :: SyntaxKind :: CONTAINS_KW } ; [icontains] => { $ crate :: SyntaxKind :: ICONTAINS_KW } ; [startswith] => { $ crate :: SyntaxKind :: STARTSWITH_KW } ; [istartswith] => { $ crate :: SyntaxKind :: ISTARTSWITH_KW } ; [endswith] => { $ crate :: SyntaxKind :: ENDSWITH_KW } ; [iendswith] => { $ crate :: SyntaxKind :: IENDSWITH_KW } ; [iequals] => { $ crate :: SyntaxKind :: IEQUALS_KW } ; [matches] => { $ crate :: SyntaxKind :: MATCHES_KW } ; [defined] => { $ crate :: SyntaxKind :: DEFINED_KW } ; [filesize] => { $ crate :: SyntaxKind :: FILESIZE_KW } ; [entrypoint] => { $ crate :: SyntaxKind :: ENTRYPOINT_KW } ; [at] => { $ crate :: SyntaxKind :: AT_KW } ; [in] => { $ crate :: SyntaxKind :: IN_KW } ; [of] => { $ crate :: SyntaxKind :: OF_KW } ; [them] => { $ crate :: SyntaxKind :: THEM_KW } ; [all] => { $ crate :: SyntaxKind :: ALL_KW } ; [any] => { $ crate :: SyntaxKind :: ANY_KW } ; [none] => { $ crate :: SyntaxKind :: NONE_KW } ; [for] => { $ crate :: SyntaxKind :: FOR_KW } ; [identifier] => { $ crate :: SyntaxKind :: IDENTIFIER } ; [variable] => { $ crate :: SyntaxKind :: VARIABLE } ; [variable_count] => { $ crate :: SyntaxKind :: VARIABLE_COUNT } ; [variable_offset] => { $ crate :: SyntaxKind :: VARIABLE_OFFSET } ; [variable_length] => { $ crate :: SyntaxKind :: VARIABLE_LENGTH } ; [string_lit] => { $ crate :: SyntaxKind :: STRING_LIT } ; [int_lit] => { $ crate :: SyntaxKind :: INT_LIT } ; [float_lit] => { $ crate :: SyntaxKind :: FLOAT_LIT } ; [bool_lit] => { $ crate :: SyntaxKind :: BOOL_LIT } ; [hex_lit] => { $ crate :: SyntaxKind :: HEX_LIT } ; [regex_lit] => { $ crate :: SyntaxKind :: REGEX_LIT } ; [dot_matches_all] => { $ crate :: SyntaxKind :: DOT_MATCHES_ALL } ; [case_insensitive] => { $ crate :: SyntaxKind :: CASE_INSENSITIVE } ; [backslash] => { $ crate :: SyntaxKind :: BACKSLASH } ; }
pub use T;
199 changes: 188 additions & 11 deletions src/syntax/ast/generated/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,15 @@ impl PrimaryExpr {
pub fn string_lit_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![string_lit])
}
pub fn variable_count(&self) -> Option<VariableCount> {
support::child(&self.syntax)
}
pub fn variable_offset(&self) -> Option<VariableOffset> {
support::child(&self.syntax)
}
pub fn variable_length(&self) -> Option<VariableLength> {
support::child(&self.syntax)
}
pub fn filesize_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![filesize])
}
Expand Down Expand Up @@ -751,6 +760,45 @@ impl FunctionCallExpr {
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VariableCount {
pub(crate) syntax: SyntaxNode,
}
impl VariableCount {
pub fn variable_count_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![variable_count])
}
pub fn in_range(&self) -> Option<InRange> {
support::child(&self.syntax)
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VariableOffset {
pub(crate) syntax: SyntaxNode,
}
impl VariableOffset {
pub fn variable_offset_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![variable_offset])
}
pub fn expr_index(&self) -> Option<ExprIndex> {
support::child(&self.syntax)
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VariableLength {
pub(crate) syntax: SyntaxNode,
}
impl VariableLength {
pub fn variable_offset_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![variable_offset])
}
pub fn expr_index(&self) -> Option<ExprIndex> {
support::child(&self.syntax)
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct IdentifierNode {
pub(crate) syntax: SyntaxNode,
Expand All @@ -762,18 +810,31 @@ impl IdentifierNode {
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExprTuple {
pub struct InRange {
pub(crate) syntax: SyntaxNode,
}
impl ExprTuple {
pub fn l_paren_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T!['('])
impl InRange {
pub fn in_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![in])
}
pub fn exprs(&self) -> AstChildren<Expr> {
support::children(&self.syntax)
pub fn range(&self) -> Option<Range> {
support::child(&self.syntax)
}
pub fn r_paren_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![')'])
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExprIndex {
pub(crate) syntax: SyntaxNode,
}
impl ExprIndex {
pub fn l_brack_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T!['['])
}
pub fn expr(&self) -> Option<Expr> {
support::child(&self.syntax)
}
pub fn r_brack_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![']'])
}
}

Expand All @@ -796,6 +857,22 @@ impl Range {
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExprTuple {
pub(crate) syntax: SyntaxNode,
}
impl ExprTuple {
pub fn l_paren_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T!['('])
}
pub fn exprs(&self) -> AstChildren<Expr> {
support::children(&self.syntax)
}
pub fn r_paren_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![')'])
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Quantifier {
pub(crate) syntax: SyntaxNode,
Expand Down Expand Up @@ -1392,6 +1469,51 @@ impl AstNode for FunctionCallExpr {
&self.syntax
}
}
impl AstNode for VariableCount {
fn can_cast(kind: SyntaxKind) -> bool {
kind == VARIABLE_COUNT
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
fn syntax(&self) -> &SyntaxNode {
&self.syntax
}
}
impl AstNode for VariableOffset {
fn can_cast(kind: SyntaxKind) -> bool {
kind == VARIABLE_OFFSET
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
fn syntax(&self) -> &SyntaxNode {
&self.syntax
}
}
impl AstNode for VariableLength {
fn can_cast(kind: SyntaxKind) -> bool {
kind == VARIABLE_LENGTH
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
fn syntax(&self) -> &SyntaxNode {
&self.syntax
}
}
impl AstNode for IdentifierNode {
fn can_cast(kind: SyntaxKind) -> bool {
kind == IDENTIFIER_NODE
Expand All @@ -1407,9 +1529,24 @@ impl AstNode for IdentifierNode {
&self.syntax
}
}
impl AstNode for ExprTuple {
impl AstNode for InRange {
fn can_cast(kind: SyntaxKind) -> bool {
kind == EXPR_TUPLE
kind == IN_RANGE
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
fn syntax(&self) -> &SyntaxNode {
&self.syntax
}
}
impl AstNode for ExprIndex {
fn can_cast(kind: SyntaxKind) -> bool {
kind == EXPR_INDEX
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Expand Down Expand Up @@ -1437,6 +1574,21 @@ impl AstNode for Range {
&self.syntax
}
}
impl AstNode for ExprTuple {
fn can_cast(kind: SyntaxKind) -> bool {
kind == EXPR_TUPLE
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
fn syntax(&self) -> &SyntaxNode {
&self.syntax
}
}
impl AstNode for Quantifier {
fn can_cast(kind: SyntaxKind) -> bool {
kind == QUANTIFIER
Expand Down Expand Up @@ -1766,12 +1918,32 @@ impl std::fmt::Display for FunctionCallExpr {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for VariableCount {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for VariableOffset {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for VariableLength {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for IdentifierNode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExprTuple {
impl std::fmt::Display for InRange {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExprIndex {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
Expand All @@ -1781,6 +1953,11 @@ impl std::fmt::Display for Range {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExprTuple {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Quantifier {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
Expand Down
Loading

0 comments on commit e52430e

Please sign in to comment.