@@ -175,38 +175,44 @@ When using the `Engine` object, you will automatically use predefined rules desi
175175
176176``` rust
177177pub type RuleSet = (
178- Forward , // Special rule that will forward inferred value in case the node is transparent
179- ParseInt , // Parse integer
180- AddInt , // +, - operations on integer
181- MultInt , // *, / operations on integer
182- ParseString , // Parse string token, including multiline strings
183- ConcatString , // String concatenation operation
184- Cast , // cast operation, like [char]0x65
185- ParseArrayLiteral , // It will parse array declared using separate value (integer or string) by a comma
186- ParseRange , // It will parse .. operator and generate an array
187- AccessString , // The access operator [] apply to a string : "foo"[0] => "f"
188- JoinComparison , // It will infer join string operation using the -join operator : @('a', 'b', 'c') -join '' => "abc"
189- JoinStringMethod , // It will infer join string operation using the [string]::join method : [string]::join('', @('a', 'b', 'c'))
190- JoinOperator , // It will infer join string operation using the -join unary operator -join @('a', 'b', 'c')
191- PSItemInferrator , // PsItem is used to inferred commandlet pattern like % { [char] $_ }
192- ForEach , // It will used PSItem rules to inferred foreach-object command
193- StringReplaceMethod ,// It will infer replace method apply to a string : "foo".replace("oo", "aa") => "faa"
194- ComputeArrayExpr , // It will infer array that start with @
195- NewObjectArray // It will infer arrays created via New-Object
196- StringReplaceOp , // It will infer replace method apply to a string by using the -replace operator
197- StaticVar , // It will infer value of known variable : $pshome, $shellid
198- CastNull , // It will infer value of +$() or -$() which will produce 0
199- ParseHash , // Parse hashtable
200- FormatString , // It will infer string when format operator is used ; "{1}-{0}" -f "Debug", "Write"
201- ParseBool , // It will infer boolean operator
202- Comparison , // It will infer comparison when it's possible
203- Not , // It will infer the ! operator
204- ParseType , // Parse type
205- DecodeBase64 , // Decode calls to FromBase64
206- FromUTF , // Decode calls to FromUTF{8,16}.GetText
207- Length , // Decode attribute length of string and array
208- BoolAlgebra , // Add support to boolean algebra (or and)
209- Var , // Variable replacement in case of predictable flow
178+ Forward , // Special rule that will forward inferred value in case the node is transparent
179+ ParseInt , // Parse integer
180+ AddInt , // +, - operations on integer
181+ MultInt , // *, / operations on integer
182+ ParseString , // Parse string token, including multiline strings
183+ ConcatString , // String concatenation operation
184+ Cast , // cast operation, like [char]0x65
185+ ParseArrayLiteral , // It will parse array declared using separate value (integer or string) by a comma
186+ ParseRange , // It will parse .. operator and generate an array
187+ AccessString , // The access operator [] apply to a string : "foo"[0] => "f"
188+ JoinComparison , // It will infer join string operation using the -join operator : @('a', 'b', 'c') -join '' => "abc"
189+ JoinStringMethod , // It will infer join string operation using the [string]::join method : [string]::join('', @('a', 'b', 'c'))
190+ JoinOperator , // It will infer join string operation using the -join unary operator -join @('a', 'b', 'c')
191+ PSItemInferrator , // PsItem is used to inferred commandlet pattern like % { [char] $_ }
192+ ForEach , // It will used PSItem rules to inferred foreach-object command
193+ StringReplaceMethod , // It will infer replace method apply to a string : "foo".replace("oo", "aa") => "faa"
194+ ComputeArrayExpr , // It will infer array that start with @
195+ NewObjectArray // It will infer arrays created via New-Object
196+ StringReplaceOp , // It will infer replace method apply to a string by using the -replace operator
197+ StaticVar , // It will infer value of known variable : $pshome, $shellid
198+ CastNull , // It will infer value of +$() or -$() which will produce 0
199+ ParseHash , // Parse hashtable
200+ FormatString , // It will infer string when format operator is used ; "{1}-{0}" -f "Debug", "Write"
201+ ParseBool , // It will infer boolean operator
202+ Comparison , // It will infer comparison when it's possible
203+ Not , // It will infer the ! operator
204+ ParseType , // Parse type
205+ DecodeBase64 , // Decode calls to FromBase64
206+ FromUTF , // Decode calls to FromUTF{8,16}.GetText
207+ Length , // Decode attribute length of string and array
208+ BoolAlgebra , // Add support to boolean algebra (or and)
209+ Var , // Variable replacement in case of predictable flow
210+ AddArray , // Array concat using +, operator
211+ StringSplitMethod , // Handle split method
212+ AccessArray , // Handle static array element access
213+ AccessHashMap , // Handle hashmap access
214+ ForStatementCondition , // Infer for condition to remove fake loops
215+ ForStatementFlowControl , // Simplify for statment based on flow control // Variable replacement in case of predictable flow
210216);
211217```
212218
0 commit comments