| @@ 1485-1495 (lines=11) @@ | ||
| 1482 | $res['php'] = '!'; |
|
| 1483 | } |
|
| 1484 | ||
| 1485 | function PresenceCheck_Argument(&$res, $sub) { |
|
| 1486 | if ($sub['ArgumentMode'] == 'string') { |
|
| 1487 | $res['php'] .= '((bool)'.$sub['php'].')'; |
|
| 1488 | } |
|
| 1489 | else { |
|
| 1490 | $php = ($sub['ArgumentMode'] == 'default' ? $sub['lookup_php'] : $sub['php']); |
|
| 1491 | // TODO: kinda hacky - maybe we need a way to pass state down the parse chain so |
|
| 1492 | // Lookup_LastLookupStep and Argument_BareWord can produce hasValue instead of XML_val |
|
| 1493 | $res['php'] .= str_replace('$$FINAL', 'hasValue', $php); |
|
| 1494 | } |
|
| 1495 | } |
|
| 1496 | ||
| 1497 | /* IfArgumentPortion: Comparison | PresenceCheck */ |
|
| 1498 | protected $match_IfArgumentPortion_typestack = array('IfArgumentPortion'); |
|
| @@ 486-496 (lines=11) @@ | ||
| 483 | $res['php'] = '!'; |
|
| 484 | } |
|
| 485 | ||
| 486 | function PresenceCheck_Argument(&$res, $sub) { |
|
| 487 | if ($sub['ArgumentMode'] == 'string') { |
|
| 488 | $res['php'] .= '((bool)'.$sub['php'].')'; |
|
| 489 | } |
|
| 490 | else { |
|
| 491 | $php = ($sub['ArgumentMode'] == 'default' ? $sub['lookup_php'] : $sub['php']); |
|
| 492 | // TODO: kinda hacky - maybe we need a way to pass state down the parse chain so |
|
| 493 | // Lookup_LastLookupStep and Argument_BareWord can produce hasValue instead of XML_val |
|
| 494 | $res['php'] .= str_replace('$$FINAL', 'hasValue', $php); |
|
| 495 | } |
|
| 496 | } |
|
| 497 | ||
| 498 | /*!* |
|
| 499 | ||