@@ -43,20 +43,20 @@ parseResult.Placeholders[0].Offset // Start 5, End 17
43
43
# Grammar
44
44
```ebnf
45
45
logic_expr =
46
- binary_op
47
- | not_expr
48
- | string_cmp_op
49
- | is_op
50
- | match_op
51
- | in_op
46
+ binary_operation
47
+ | not_operation
48
+ | string_comparison_operation
49
+ | type_check_operation
50
+ | match_operation
51
+ | in_operation
52
52
| '(' logic_expr ')'
53
53
54
- binary_op = logic_expr ('And' | 'Or' | 'NAND' | 'NOR' | 'XOR' | 'XNOR' ) logic_expr
55
- string_cmp_op = string_expr ('Equals' | 'Contains' | 'StartsWith' | 'EndsWith' ) string_expr
56
- not_expr = 'Not' logic_expr
57
- is_op = string_expr 'Is' ('Var' | 'Int' | 'Double' | 'DateTime' | 'Guid' )
58
- match_op = string_expr 'Match' '"' < regex > '"'
59
- in_op = string_expr 'In' [ '(' ] string_expr { ',' string_expr } [ ')' ]
54
+ binary_operation = logic_expr ('And' | 'Or' | 'NAND' | 'NOR' | 'XOR' | 'XNOR' ) logic_expr
55
+ string_comparison_operation = string_expr ('Equals' | 'Contains' | 'StartsWith' | 'EndsWith' ) string_expr
56
+ not_operation = 'Not' logic_expr
57
+ type_check_operation = string_expr 'Is' ('Var' | 'Int' | 'Double' | 'DateTime' | 'Guid' )
58
+ match_operation = string_expr 'Match' '"' < regex > '"'
59
+ in_operation = string_expr 'In' [ '(' ] string_expr { ',' string_expr } [ ')' ]
60
60
61
61
string_expr =
62
62
grouped_string
@@ -72,13 +72,12 @@ property_access =
72
72
placeholder '.' (
73
73
'Length'
74
74
| complex_property
75
- | input_property [ chainable_string_ops ]
75
+ | input_property [ chainable_string ]
76
76
)
77
- | placeholder [ chainable_string_ops ]
77
+ | placeholder [ chainable_string ]
78
78
79
- chainable_string_ops = { '.' chainable_operation }
79
+ chainable_string = { '.' ( 'Trim' | 'TrimEnd' | 'TrimStart' | 'ToUpper' | 'ToLower' ) }
80
80
81
- chainable_operation = 'Trim' | 'TrimEnd' | 'TrimStart' | 'ToUpper' | 'ToLower'
82
81
input_property = 'Input.' identifier
83
82
complex_property = ('Offset' | 'Line' | 'Column' ) '.' ('Start' | 'End' )
84
83
@@ -87,22 +86,6 @@ placeholder = '$' identifier '$'
87
86
string_literal = < escaped string >
88
87
whitespace = (' ' | '\n ' | '\r ' )+
89
88
comment = < single or multiline comment >
90
-
91
- find_rule = logic_expr
92
-
93
- replace_rule =
94
- 'if' logic_expr 'then' assignment
95
- | assignment
96
-
97
- assignment = placeholder '=>' string_expr
98
-
99
- template_component = placeholder | string_literal | whitespace
100
-
101
- template =
102
- '(' template ')'
103
- | '{' template '}'
104
- | '[' template ']'
105
- | template_component +
106
89
```
107
90
108
91
## Getting Started📂
0 commit comments