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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ jobs:
bundle install
- name: Run test
run: rake compile test
env:
RUBYOPT: "--enable-frozen-string-literal --debug=frozen-string-literal"
2 changes: 1 addition & 1 deletion lib/racc/grammarfileparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def skip_comment
$raccs_print_type = false

def scan_action
buf = ''
buf = String.new
nest = 1
pre = nil
@in_block = 'action'
Expand Down
4 changes: 2 additions & 2 deletions lib/racc/parserfilegenerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def make_separator(src)
end

def unique_separator(id)
sep = "...end #{id}/module_eval..."
sep = String.new "...end #{id}/module_eval..."
while @used_separator.key?(sep)
sep.concat sprintf('%02x', rand(255))
end
Expand Down Expand Up @@ -329,7 +329,7 @@ def serialize_integer_list_compressed(name, table)
# TODO: this can be made a LOT more clean with a simple split/map
sep = "\n"
nsep = ",\n"
buf = ''
buf = String.new
com = ''
ncom = ','
co = com
Expand Down
2 changes: 1 addition & 1 deletion lib/racc/statetransitiontable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def addent(all, arr, chkval, ptr)
def mkmapexp(arr)
i = ii = 0
as = arr.size
map = ''
map = String.new
maxdup = RE_DUP_MAX
curr = nil
while i < as
Expand Down