Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ExpressionLanguage] Add a way to hook on each node when dumping the AST#19060

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:es-dump
Jun 15, 2016

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?"master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#19013
LicenseMIT
Doc PR-

This is an iteration over#19013 to allow writing dumpers that can decorate dumps (e.g. add HTML tags based on each node type to do syntax highlighting).

}

$arg =newNode\ConstantNode($token->value);
$arg =newNode\NameNode($token->value);
Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasJun 15, 2016
edited
Loading

Choose a reason for hiding this comment

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

The AST is more correct when usingNameNode instead ofConstantNode for representingGetAttrNode::PROPERTY_CALL andGetAttrNode::METHOD_CALL (but keepConstantNodeforGetAttrNode::ARRAY_CALL).
This is enlighten by the "unescaping" (this trim) that was required otherwise when dumping aGetAttrNode.

Copy link
Member

Choose a reason for hiding this comment

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

I tend to agree that this semantically more correct. Is it a BC break? I don't think so.

Copy link
Member

Choose a reason for hiding this comment

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

Yes it's a BC break. I createda melody script to reproduce it.

@fabpot it's because of this change your gist your sent me yesterday does not work anymore.

Copy link
Member

Choose a reason for hiding this comment

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

Arf, any change is a BC break after all :)

Copy link
Member

Choose a reason for hiding this comment

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

So, we need to revert this change, that's two issues as of now.

Copy link
Member

Choose a reason for hiding this comment

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

reverted now

$tokens[] =',';
$tokens[] =$pair['value'];
}
array_shift($tokens);
Copy link
Member

Choose a reason for hiding this comment

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

isn't it better to add the, token after each pair, and to pop the last one here ? It would avoid having to reindex the array

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed

@nicolas-grekasnicolas-grekasforce-pushed thees-dump branch 2 times, most recently froma5e5273 to82177f4CompareJune 15, 2016 09:58
publicfunctiondump()
{
$str ='';
$tokens =array();
Copy link
Member

Choose a reason for hiding this comment

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

Token has another meaning in the component, so we need to use something else.

@fabpot
Copy link
Member

You should also add a phpdoc to thedump() method onNode at least for the return value.

@fabpot
Copy link
Member

And I think that thedump() method onNodes should be changed to something else as I would expect a dump method to return a string, not an array.

@nicolas-grekas
Copy link
MemberAuthor

Comments addressed,dump() renamed totoArray()

@fabpot
Copy link
Member

👍

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit66d23db intosymfony:masterJun 15, 2016
fabpot added a commit that referenced this pull requestJun 15, 2016
…en dumping the AST (nicolas-grekas)This PR was merged into the 3.2-dev branch.Discussion----------[ExpressionLanguage] Add a way to hook on each node when dumping the AST| Q             | A| ------------- | ---| Branch?       | "master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19013| License       | MIT| Doc PR        | -This is an iteration over#19013 to allow writing dumpers that can decorate dumps (e.g. add HTML tags based on each node type to do syntax highlighting).Commits-------66d23db [ExpressionLanguage] Add a way to hook on each node when dumping the AST
@nicolas-grekasnicolas-grekas deleted the es-dump branchJune 15, 2016 16:40
fabpot added a commit that referenced this pull requestSep 21, 2016
This PR was merged into the 3.2-dev branch.Discussion----------[ExpressionLanguage] fixed a BC break| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | fixes a BC break :)| Deprecations? | no| Tests pass?   | yes| Fixed tickets | see#19060 (comment)| License       | MIT| Doc PR        | n/aCommits-------b00930f [ExpressionLanguage] fixed a BC break
@fabpotfabpot mentioned this pull requestOct 27, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

@lyrixxlyrixxlyrixx left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@fabpot@lyrixx@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp