Skip to content

Commit f2d6017

Browse files
Update README.md
1 parent 2114c40 commit f2d6017

File tree

1 file changed

+15
-32
lines changed

1 file changed

+15
-32
lines changed

README.md

+15-32
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ parseResult.Placeholders[0].Offset // Start 5, End 17
4343
# Grammar
4444
```ebnf
4545
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
5252
| '(' logic_expr ')'
5353

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 } [ ')' ]
6060

6161
string_expr =
6262
grouped_string
@@ -72,13 +72,12 @@ property_access =
7272
placeholder '.' (
7373
'Length'
7474
| complex_property
75-
| input_property [ chainable_string_ops ]
75+
| input_property [ chainable_string ]
7676
)
77-
| placeholder [ chainable_string_ops ]
77+
| placeholder [ chainable_string ]
7878

79-
chainable_string_ops = { '.' chainable_operation }
79+
chainable_string = { '.' ('Trim' | 'TrimEnd' | 'TrimStart' | 'ToUpper' | 'ToLower') }
8080

81-
chainable_operation = 'Trim' | 'TrimEnd' | 'TrimStart' | 'ToUpper' | 'ToLower'
8281
input_property = 'Input.' identifier
8382
complex_property = ('Offset' | 'Line' | 'Column') '.' ('Start' | 'End')
8483

@@ -87,22 +86,6 @@ placeholder = '$' identifier '$'
8786
string_literal = <escaped string>
8887
whitespace = (' ' | '\n' | '\r')+
8988
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+
10689
```
10790

10891
## Getting Started📂

0 commit comments

Comments
 (0)