8000 [Yaml] Allow comments after tab by superdav42 · Pull Request #15747 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] Allow comments after tab #15747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Prev Previous commit
Next Next commit
Use Yoda style Comments
  • Loading branch information
superdav42 committed Sep 14, 2015
commit c5ed1335e2ab463bc13fce391efca3f6cf0319a0
2 changes: 1 addition & 1 deletion src/Symfony/Component/Yaml/Inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter
$i += strlen($output);

// remove comments
if ((false !== $strpos = strpos($output, '#')) && ($output[$strpos - 1] == ' ' || $output[$strpos - 1] == "\t")) {
if ((false !== $strpos = strpos($output, '#')) && (' ' === $output[$strpos - 1] || "\t" === $output[$strpos - 1])) {
$output = rtrim(substr($output, 0, $strpos));
}
} elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {
Expand Down
0