Skip to content

Commit bec2f47

Browse files
StartAutomatingStartAutomating
authored andcommitted
Adding EqualityComparison (#123)
1 parent eaace02 commit bec2f47

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

docs/EqualityComparison.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
EqualityComparison
3+
------------------
4+
### Synopsis
5+
Allows equality comparison.
6+
7+
---
8+
### Description
9+
10+
Allows most equality comparison using double equals (==).
11+
12+
Many languages support this syntax. PowerShell does not.
13+
14+
This transpiler enables equality comparison with ==.
15+
16+
---
17+
### Examples
18+
#### EXAMPLE 1
19+
```PowerShell
20+
Invoke-PipeScript -ScriptBlock {
21+
$a = 1
22+
if ($a == 1 ) {
23+
"A is $a"
24+
}
25+
}
26+
```
27+
28+
#### EXAMPLE 2
29+
```PowerShell
30+
{
31+
$a == "b"
32+
} | .>PipeScript
33+
```
34+
35+
---
36+
### Parameters
37+
#### **AssignmentStatementAST**
38+
39+
The original assignment statement.
40+
41+
42+
43+
|Type |Requried|Postion|PipelineInput |
44+
|------------------------------|--------|-------|--------------|
45+
|```[AssignmentStatementAst]```|true |1 |true (ByValue)|
46+
---
47+
### Syntax
48+
```PowerShell
49+
EqualityComparison [-AssignmentStatementAST] <AssignmentStatementAst> [<CommonParameters>]
50+
```
51+
---
52+
### Notes
53+
This will not work if there is a constant on both sides of the expression
54+
55+
56+
if ($null == $null) { "this will work"}
57+
if ('' == '') { "this will not"}
58+
59+
60+

0 commit comments

Comments
 (0)