8000 [Yaml] Wrong line number when comments are inserted in the middle of a block · Issue #15437 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] Wrong line number when comments are inserted in the middle of a block #15437

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
nicolas-grekas opened this issue Aug 3, 2015 · 1 comment

Comments

@nicolas-grekas
Copy link
Member

This yaml:

foo:
    -
        # bar
        bar: "123",

triggers:
Unexpected characters near "," at line 3 (near "bar: "123",").

The line number is wrong (it should be 4).
This is because Parser::getNextEmbedBlock() removes the comment line before the parse error occurs.

@xabbuh
Copy link
Member
xabbuh commented Dec 5, 2015

Status: Reviewed

8000
@xabbuh xabbuh added this to the 3.1 milestone Feb 8, 2016
fabpot added a commit that referenced this issue Jun 8, 2016
… the middle of a block. (paradajozsef)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #17733).

Discussion
----------

[Yaml] Fix wrong line number when comments are inserted in the middle of a block.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15437
| License       | MIT
| Doc PR        | -

@xabbuh what is your opinion a solution like this? (counting the skipped comment lines and when exception occurs add them to the current line count.)

Commits
-------

d83e346 [Yaml] Fix wrong line number when comments are inserted in the middle of a block.
@fabpot fabpot closed this as completed Jun 8, 2016
fabpot added a commit that referenced this issue Jun 12, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] properly count skipped comment lines

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15437, #17733, #19023
| License       | MIT
| Doc PR        |

Commits
-------

da7fc36 [Yaml] properly count skipped comment lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0