-
Notifications
You must be signed in to change notification settings - Fork 45
Implement StringScanner for TruffleRuby in pure Ruby #195
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
+463
−31
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bc0fd1e
Implement StringScanner for TruffleRuby in pure Ruby
eregon 836a35e
Fix a couple bugs in the new implementation
eregon b092394
Contribute the new file under the existing BSD-2-Clause LICENSE.txt a…
eregon a48ed59
Test on truffleruby-33, truffleruby and truffleruby-head
eregon 97422f0
Rename file
eregon e0c30dc
Optimize rest_size
eregon 9b619fa
Remove ad-hoc uninitialized checks and omit part of the test on truff…
eregon 867b56b
Cleanup scan_byte
eregon 4c5d3b6
Cleaner error
eregon 9ee6ffe
Make `rake version:bump` also update the version in lib/strscan/truff…
eregon 3a35d42
Remove old exclude for truffleruby
eregon e934ac3
Run only a smoke test for older truffleruby using stdlib and not the …
eregon efa8c7f
Remove test_s_allocate based on PR review
eregon 8723257
Add defined? check for ScanError to be consistent with strscan.c
eregon 13961d4
Use base.inspect in error message
eregon 59e137c
Avoid an extra Range allocation for #rest in interpreter
eregon e08a23b
Add frozen_string_literal
eregon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| case RUBY_ENGINE | ||
| when 'ruby' | ||
| require 'strscan.so' | ||
| require_relative 'strscan/strscan' | ||
| when 'jruby' | ||
| require 'strscan.jar' | ||
| JRuby::Util.load_ext('org.jruby.ext.strscan.StringScannerLibrary') | ||
| require_relative 'strscan/strscan' | ||
| when 'truffleruby' | ||
| if RUBY_ENGINE_VERSION.to_i >= 34 | ||
| require 'strscan/truffleruby' | ||
| else | ||
| $LOAD_PATH.delete __dir__ | ||
| require 'strscan' | ||
eregon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| end | ||
| else | ||
| raise NotImplementedError, "Unknown Ruby: #{RUBY_ENGINE}" | ||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.