Add special variables detection

This commit is contained in:
Dmitriy Simushev 2014-09-02 13:08:20 +00:00
parent 17dc20203b
commit 2ebc5bfda2

View File

@ -111,10 +111,12 @@ class Arguments
$name_chunk = '(?:[^' . $bad_chars . '\s]+)|(?:\[[^' . $bad_seg_chars . ']+\])';
$variable_name = '(?:\.\.\/)*(?:(?:' . $name_chunk . ')[\.\/])*(?:' . $name_chunk . ')\.?';
$special_variable_name = '@[a-z]+';
$escaped_value = '(?:(?<!\\\\)".*?(?<!\\\\)"|(?<!\\\\)\'.*?(?<!\\\\)\')';
$argument_name = $name_chunk;
$positional_argument = '#^(' . $variable_name . '|' . $escaped_value . ')#';
$named_argument = '#^(' . $argument_name . ')\s*=\s*(' . $escaped_value . '|' . $variable_name . ')#';
$argument_value = $variable_name . '|' . $escaped_value . '|' . $special_variable_name;
$positional_argument = '#^(' . $argument_value . ')#';
$named_argument = '#^(' . $argument_name . ')\s*=\s*(' . $argument_value . ')#';
$current_str = trim($args_string);