Skip to content

support Ruby 2.4's frozen string literals (1.4.x branch) #80

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

Conversation

flavorjones
Copy link
Collaborator

Note this change is made relative to the 1-4-stable branch.

It would be great to cut an updated 1.4.x release after merging this in.

@flavorjones
Copy link
Collaborator Author

Note that you can test before/after by setting RUBYOPT="--enable-frozen-string-literal --debug=frozen-string-literal"

@drbrain
Copy link
Member

drbrain commented Feb 16, 2017

Will an eval test work?

@flavorjones
Copy link
Collaborator Author

@drbrain Not sure what you mean?

@drbrain
Copy link
Member

drbrain commented Feb 16, 2017

A test like:

parser_output = Racc.generate_a_parser "grammar"

eval "# frozen_string_literal: true\n#{parser_output}"

Parser.parse "something"

assert true, "Parser didn't raise a frozen string exception, 🎊"

@flavorjones flavorjones changed the title support Ruby 2.4's frozen string literals support Ruby 2.4's frozen string literals (1.4.x branch) Feb 16, 2017
@flavorjones
Copy link
Collaborator Author

Ah, I see what you're getting at.

For the 1.4 branch, this changeset was small, but check out what had to be done for master: #81

So I'd personally prefer to see the entire test suite run with the frozen strings option; unfortunately the travis setup is outdated and has been failing for some time. I'll add a commit fixing it up, and you can be the judge.

@drbrain
Copy link
Member

drbrain commented Feb 17, 2017

👍🏻

@pat
Copy link

pat commented Jun 23, 2017

I realise this PR has been dormant for quite some time. Would love to get frozen string literal support in though!

With regards to getting things on Travis green: I've just done some poking around, and added the following to try to get the tests running. They're actually running on 1.9 (albeit with some failures), but no luck elsewhere (due to minitest/autorun not being available for some reason): flavorjones/racc@flavorjones-1.4-frozen-string-literal...pat:flavorjones-1.4-frozen-string-literal - the results can be found at https://travis-ci.org/pat/racc - any thoughts on next steps are very welcome :)

@hsbt
Copy link
Member

hsbt commented Oct 30, 2019

@flavorjones Can you rebase with the current 1-4-stable branch?

@flavorjones flavorjones force-pushed the flavorjones-1.4-frozen-string-literal branch from eeda605 to 1521a41 Compare October 31, 2019 12:31
@flavorjones
Copy link
Collaborator Author

Rebased and pushed! Please take a look at my edit to the github actions, I'm not 100% sure what I'm doing there.

@flavorjones flavorjones force-pushed the flavorjones-1.4-frozen-string-literal branch from 1521a41 to 4c8f763 Compare October 31, 2019 13:06
@flavorjones
Copy link
Collaborator Author

Re-pushed with an updated change to lib/racc/parserfilegenerator.rb to address frozen string test failures.

@flavorjones
Copy link
Collaborator Author

OK - I'm not sure why the Actions aren't passing, this is green on my local machine. Can I request a second pair of eyes on this?

@hsbt hsbt closed this Dec 10, 2019
@flavorjones
Copy link
Collaborator Author

@hsbt - can you help me understand why this was closed without merging? I rebased as you requested and tests were green.

@hsbt
Copy link
Member

hsbt commented Dec 10, 2019

@flavorjones Ah, I renamed 1-4-stable to master branch. Can you submit this pull-request from master branch again?

@flavorjones
Copy link
Collaborator Author

@hsbt resubmitted as #127 rebased on master

@flavorjones flavorjones deleted the flavorjones-1.4-frozen-string-literal branch February 24, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants