Skip to content

Commit

Permalink
[Yaml] made a small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Aug 22, 2011
1 parent 8c5b6aa commit 12a852e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Yaml/Parser.php
Expand Up @@ -66,7 +66,7 @@ public function parse($value)
}

// tab?
if (preg_match('#^\t+#', $this->currentLine)) {
if ("\t" === $this->currentLine[0]) {
throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
}

Expand Down

2 comments on commit 12a852e

@Seldaek
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should maybe be if ("\t" === ltrim($this->currentLine, ' ')) though, to account for mixed tab/space indentation, like:

  \tfoo: bar

@fabpot
Copy link
Member Author

@fabpot fabpot commented on 12a852e Aug 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's already taken into account as all "real" whitespaces have already been removed at this point.

Please sign in to comment.