| @@ 1473-1483 (lines=11) @@ | ||
| 1470 | $res['php'] = '!'; |
|
| 1471 | } |
|
| 1472 | ||
| 1473 | function PresenceCheck_Argument(&$res, $sub) { |
|
| 1474 | if ($sub['ArgumentMode'] == 'string') { |
|
| 1475 | $res['php'] .= '((bool)'.$sub['php'].')'; |
|
| 1476 | } |
|
| 1477 | else { |
|
| 1478 | $php = ($sub['ArgumentMode'] == 'default' ? $sub['lookup_php'] : $sub['php']); |
|
| 1479 | // TODO: kinda hacky - maybe we need a way to pass state down the parse chain so |
|
| 1480 | // Lookup_LastLookupStep and Argument_BareWord can produce hasValue instead of XML_val |
|
| 1481 | $res['php'] .= str_replace('$$FINAL', 'hasValue', $php); |
|
| 1482 | } |
|
| 1483 | } |
|
| 1484 | ||
| 1485 | /* IfArgumentPortion: Comparison | PresenceCheck */ |
|
| 1486 | protected $match_IfArgumentPortion_typestack = array('IfArgumentPortion'); |
|
| @@ 485-495 (lines=11) @@ | ||
| 482 | $res['php'] = '!'; |
|
| 483 | } |
|
| 484 | ||
| 485 | function PresenceCheck_Argument(&$res, $sub) { |
|
| 486 | if ($sub['ArgumentMode'] == 'string') { |
|
| 487 | $res['php'] .= '((bool)'.$sub['php'].')'; |
|
| 488 | } |
|
| 489 | else { |
|
| 490 | $php = ($sub['ArgumentMode'] == 'default' ? $sub['lookup_php'] : $sub['php']); |
|
| 491 | // TODO: kinda hacky - maybe we need a way to pass state down the parse chain so |
|
| 492 | // Lookup_LastLookupStep and Argument_BareWord can produce hasValue instead of XML_val |
|
| 493 | $res['php'] .= str_replace('$$FINAL', 'hasValue', $php); |
|
| 494 | } |
|
| 495 | } |
|
| 496 | ||
| 497 | /*!* |
|
| 498 | ||