Commit a90ee252 authored by Nicolas Grekas's avatar Nicolas Grekas
Browse files

Merge branch '6.0' into 6.1

* 6.0:
  [Console] Correctly overwrite progressbars with different line count per step
  [DependencyInjection] Fix deduplicating service instances in circular graphs
  [Form] Make `ButtonType` handle `form_attr` option
  [PhpUnitBridge] Use verbose deprecation output for quiet types only when it reaches the threshold
  [CssSelector] Fix escape patterns
parents 0dd5e36b 3e526b73
Showing with 14 additions and 4 deletions
+14 -4
......@@ -49,22 +49,22 @@ class TokenizerPatterns
$this->identifierPattern = '-?(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*';
$this->hashPattern = '#((?:'.$this->nmCharPattern.')+)';
$this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)';
$this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*';
$this->quotedStringPattern = '([^\n\r\f\\\\%s]|'.$this->stringEscapePattern.')*';
}
public function getNewLineEscapePattern(): string
{
return '~^'.$this->newLineEscapePattern.'~';
return '~'.$this->newLineEscapePattern.'~';
}
public function getSimpleEscapePattern(): string
{
return '~^'.$this->simpleEscapePattern.'~';
return '~'.$this->simpleEscapePattern.'~';
}
public function getUnicodeEscapePattern(): string
{
return '~^'.$this->unicodeEscapePattern.'~i';
return '~'.$this->unicodeEscapePattern.'~i';
}
public function getIdentifierPattern(): string
......
......@@ -138,6 +138,16 @@ class ParserTest extends TestCase
['div:not(div.foo)', ['Negation[Element[div]:not(Class[Element[div].foo])]']],
['td ~ th', ['CombinedSelector[Element[td] ~ Element[th]]']],
['.foo[data-bar][data-baz=0]', ["Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]"]],
['div#foo\.bar', ['Hash[Element[div]#foo.bar]']],
['div.w-1\/3', ['Class[Element[div].w-1/3]']],
['#test\:colon', ['Hash[Element[*]#test:colon]']],
[".a\xc1b", ["Class[Element[*].a\xc1b]"]],
// unicode escape: \22 == "
['*[aval="\'\22\'"]', ['Attribute[Element[*][aval = \'\'"\'\']]']],
['*[aval="\'\22 2\'"]', ['Attribute[Element[*][aval = \'\'"2\'\']]']],
// unicode escape: \20 == (space)
['*[aval="\'\20 \'"]', ['Attribute[Element[*][aval = \'\' \'\']]']],
["*[aval=\"'\\20\r\n '\"]", ['Attribute[Element[*][aval = \'\' \'\']]']],
];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment