Skip to content

Commit 9d0a1eb

Browse files
authored
Merge pull request #94 from jacekkarczmarczyk/feat/#93-eqq-nee
feat: eqq (===) and nee (!==) operators
2 parents 5f4eb21 + 41eac92 commit 9d0a1eb

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

classes/PHPTAL/Php/Transformer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,14 @@ private static function isVarNameChar($c)
406406
private static $TranslationTable = array(
407407
'not' => '!',
408408
'ne' => '!=',
409+
'nee' => '!==',
409410
'and' => '&&',
410411
'or' => '||',
411412
'lt' => '<',
412413
'gt' => '>',
413414
'ge' => '>=',
414415
'le' => '<=',
415416
'eq' => '==',
417+
'eqq' => '===',
416418
);
417419
}
418-

doc/de/book.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,9 +1452,15 @@ this page has been readed ${page/countRead} times"/>
14521452
<listitem><para>
14531453
<code>==</code> : <code>EQ</code> (gleich)
14541454
</para></listitem>
1455+
<listitem><para>
1456+
<code>===</code> : <code>EQQ</code> (exakt gleich)
1457+
</para></listitem>
14551458
<listitem><para>
14561459
<code>!=</code> : <code>NE</code> (ungleich)
14571460
</para></listitem>
1461+
<listitem><para>
1462+
<code>!==</code> : <code>NEE</code> (exakt ungleich)
1463+
</para></listitem>
14581464
<listitem><para>
14591465
<code>&amp;&amp;</code> : <code>AND</code>
14601466
</para></listitem>

doc/en/book.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,9 +1517,15 @@ this page has been readed ${page/countRead} times"/>
15171517
<code>==</code> : <code>EQ</code> (equal)
15181518
</para></listitem>
15191519
<listitem><para>
1520+
<code>===</code> : <code>EQQ</code> (strictly equal)
1521+
</para></listitem>
1522+
<listitem><para>
15201523
<code>!=</code> : <code>NE</code> (not equal)
15211524
</para></listitem>
15221525
<listitem><para>
1526+
<code>!=</code> : <code>NEE</code> (strictly not equal)
1527+
</para></listitem>
1528+
<listitem><para>
15231529
<code>&amp;&amp;</code> : <code>AND</code>
15241530
</para></listitem>
15251531
<listitem><para>

doc/ja/book.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,9 +1350,15 @@ this page has been readed ${page/countRead} times"/>
13501350
<code>==</code> : <code>EQ</code> (等しい)
13511351
</para></listitem>
13521352
<listitem><para>
1353+
<code>===</code> : <code>EQQ</code> (厳密に等しい)
1354+
</para></listitem>
1355+
<listitem><para>
13531356
<code>!=</code> : <code>NE</code> (等しくない)
13541357
</para></listitem>
13551358
<listitem><para>
1359+
<code>!==</code> : <code>NEE</code> (厳密に等しくない)
1360+
</para></listitem>
1361+
<listitem><para>
13561362
<code>&amp;&amp;</code> : <code>AND</code>
13571363
</para></listitem>
13581364
<listitem><para>

doc/ru/book.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,9 +1117,15 @@ this page has been readed ${page/countRead} times"/>
11171117
<code>==</code> : <code>EQ</code> (equal)
11181118
</para></listitem>
11191119
<listitem><para>
1120+
<code>===</code> : <code>EQQ</code> (strictly equal)
1121+
</para></listitem>
1122+
<listitem><para>
11201123
<code>!=</code> : <code>NE</code> (not equal)
11211124
</para></listitem>
11221125
<listitem><para>
1126+
<code>!==</code> : <code>NEE</code> (strictly not equal)
1127+
</para></listitem>
1128+
<listitem><para>
11231129
<code>&amp;&amp;</code> : <code>AND</code>
11241130
</para></listitem>
11251131
<listitem><para>

tests/PhpTransformerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ function testKeywords()
123123
{
124124
$this->assertEquals('true != false', PHPTAL_Php_Transformer::transform('true ne false'));
125125
$this->assertEquals('$test == null', PHPTAL_Php_Transformer::transform('test eq null'));
126+
$this->assertEquals('true !== false', PHPTAL_Php_Transformer::transform('true nee false'));
127+
$this->assertEquals('$test === null', PHPTAL_Php_Transformer::transform('test eqq null'));
126128
}
127129

128130
function testTernaryOperator()
@@ -188,4 +190,3 @@ function testCatchesInvalidNumber2()
188190
$tpl->execute();
189191
}
190192
}
191-

0 commit comments

Comments
 (0)