Skip to content

Perl formatter improvement #173

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

Merged
merged 3 commits into from
Mar 15, 2015

Conversation

jamadam
Copy link
Contributor

@jamadam jamadam commented Feb 26, 2014

The patch improves Perl code on non-ascii output. It reduces charactor corruption and well known warnings 'Wide character in print'.

It also change the literal delimiter from "" to '' or q{} or q() to reduce variable escaping so that the test cases get more readable.

Since I haven't figure out how to build xpi so far, the patch is not properly tested.

value = value.replace(/\r/g, '\\r');
value = value.replace(/\n/g, '\\n');
value = value.replace(/@/g, '\\@');
value = value.replace(/\$/g, '\\$');
Copy link
Member

Choose a reason for hiding this comment

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

Why is the escaping of @ and $ removed?

@andreastt
Copy link
Member

Generally I think this patch looks fine. Have you signed the CLA?

I'd like @samitbadle to have a look.

@jamadam
Copy link
Contributor Author

jamadam commented Feb 26, 2014

Thank you for quick reply.

Why is the escaping of @ and $ removed?

Single quotation doesn't expand variables so you don't need to escape them any more.

Technically you could do "''" instead of ''''?

It's a matter of taste. And I must say that q{} and q() usage is more debatable. Some people may don't like it.

Generally I think this patch looks fine. Have you signed the CLA?

Yes I did.

@jamadam
Copy link
Contributor Author

jamadam commented Feb 26, 2014

@andreastt

Technically you could do "''" instead of ''''?

Sorry your code was better and it7s not a matter of taste.
I confused Perl code and JS code. On Perl, double qoutes costs more than single quote for expanding variables but it's not true for JS.

@samitbadle
Copy link
Contributor

I will give it a run today, I have a new webdriver based Perl formatter as
well that need to be released.

On Wed, Feb 26, 2014 at 5:20 AM, jamadam [email protected] wrote:

@andreastt https://github.com/andreastt

Technically you could do "''" instead of ''''?

Sorry your code was better and it7s not a matter of taste.
I confused Perl code and JS code. On Perl, double qoutes costs more than
single quote for expanding variables but it's not true for JS.

Reply to this email directly or view it on GitHubhttps://github.com//pull/173#issuecomment-36089539
.

@samitbadle
Copy link
Contributor

I found a bug in one of the patches and had to put it aside until I got more time. I hope to check it out further tomorrow. Were there any tests for the patches?

On 26 Feb 2014, at 04:21, Andreas Tolfsen [email protected] wrote:

Generally I think this patch looks fine. Have you signed the CLA?

I'd like @samitbadle to have a look.


Reply to this email directly or view it on GitHub.

@andreastt andreastt added J-awaiting answer Question asked of user; a reply moves it to triage again A-needs decision TLC needs to discuss and agree Z-ide Archived; see separate project labels Mar 2, 2015
@andreastt
Copy link
Member

@samitbadle, did you have time to look at the bug you found?

@samitbadle
Copy link
Contributor

I believe I fixed it, but need to merge the code. I will not have any time before this Friday.

On 2 Mar 2015, at 21:54, Andreas Tolfsen [email protected] wrote:

@samitbadle, did you have time to look at the bug you found?


Reply to this email directly or view it on GitHub.

@samitbadle
Copy link
Contributor

Awaiting write access

@andreastt
Copy link
Member

@samitbadle, consider yourself invited!

} else {
return '""';
return "'";
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be return "''"; I will fix it

@samitbadle
Copy link
Contributor

Thanks Andreas, now waiting for the clone, I need faster internet!

samitbadle added a commit that referenced this pull request Mar 15, 2015
@samitbadle samitbadle merged commit c568c54 into SeleniumHQ:master Mar 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs decision TLC needs to discuss and agree J-awaiting answer Question asked of user; a reply moves it to triage again Z-ide Archived; see separate project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants