Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c9790ea19b97
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2614c773b8f4
Choose a head ref
  • 8 commits
  • 8 files changed
  • 2 contributors

Commits on Jan 14, 2018

  1. Extract parseRegexpFlags to Lexer

    And use the same function from both Ripper and main parser.
    grddev committed Jan 14, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    aurelien-reeves Aurélien Reeves
    Copy the full SHA
    0829a85 View commit details
  2. Move Regexp checking from ParserSupport to Lexer

    While not really related to Lexing, this is a component that is shared between Ripper and the main parser, and that seemed like the lesser evil.
    grddev committed Jan 14, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    aurelien-reeves Aurélien Reeves
    Copy the full SHA
    54a483b View commit details
  3. Align validation code with MRI

    It seems to have been `!ENCODING_IS_ASCII8BIT(str)` from the beginning, so I'm not sure why it was the opposite here.
    grddev committed Jan 14, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    aurelien-reeves Aurélien Reeves
    Copy the full SHA
    57661ef View commit details
  4. Make sure to clear $! when rescuing RaiseException

    The code was copied from Parser support, so it was clearly broken before, but it had to be fixed now as parts of the Ripper test suite relies on $! rather than explicitly catching the exception.
    grddev committed Jan 14, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    aurelien-reeves Aurélien Reeves
    Copy the full SHA
    a089f8a View commit details
  5. Add support for validating Regexp in Ripper

    This uses the fact that Regexp tokenization is handled by a single StringTerm, and thus all tSTRING_CONTENT fragments are easily collectable until the tREGEXP_END comes with the options that we need for validation.
    
    The validation itself is a copied/simplified version of what is performed by the main parser, as large parts the validation depended on the AST structure, which we do not have here.
    
    Technically, this doesn't perform the validation at the same point in time as the main parser, as it performs the validation when encountering the tREGEXP_END token rather than when processing the regexp rule.
    
    I speculate that the difference doesn't really matter given that the only thing we could do with the tREGEXP_END token is to apply the regexp rule.
    grddev committed Jan 14, 2018
    Copy the full SHA
    38d526b View commit details
  6. Simplify the regexp validation logic

    Use a separate variable to track whether things are dynamic or not, and use a List to avoid tracking the last element explicitly.
    grddev committed Jan 14, 2018
    Copy the full SHA
    d3a8051 View commit details
  7. Inline the regexp validation inside ParserSupport

    The methods were only retained to provide the old interface, but by directly calling the new methods in the Lexer, we can remove the old methods, given that we don't really need to be backwards compatible here.
    grddev committed Jan 14, 2018
    Copy the full SHA
    836f80e View commit details
  8. Merge pull request #4902 from grddev/ripper-regex

    Add support for validating Regexp in Ripper
    enebo authored Jan 14, 2018
    Copy the full SHA
    2614c77 View commit details
Loading