1
0
mirror of https://github.com/silverstripe/silverstripe-framework synced 2024-10-22 12:05:37 +00:00
2011-02-14 14:58:57 +13:00

26 lines
474 B
PHP

<?php
require '../Parser.php' ;
class CalculatedLiterals extends Parser {
/*!* CalculatedLiterals
string: ( /\\./ | /[^${parent.q}]/ )*
simplequote: q:/['"]/ string '$q'
freequote-matched: "qq" q:/[{\[(<]/ string '$matched'
function $matched( $res ) {
$a = array( '{' => '}', '[' => ']', '(' => ')', '<' => '>' ) ;
return $a[$res['q']] ;
}
freequote-unmatched: "qq" q:/./ string '$q'
quoted-string: freequote-matched | freequote-unmatched | simplequote
*/
}