Skip to content
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

Add support for quoted symbols #1168

Merged
merged 3 commits into from May 28, 2018

Commits on May 19, 2018

  1. Tokenize quoted symbols correctly (Ruby 2.2 style :'_sym+bol')

    Without the fix, the new test "properly tokenizes symbols" would fail with:
    
    ```
      1) YARD::Parser::Ruby::RubyParser#parse properly tokenizes symbols
         Failure/Error: expect(symbols).to eq %w( :'' :BAR :"B+z" )
    
           expected: [":''", ":BAR", ":\"B+z\""]
                got: [":'", ":BAR", ":B+z"]
    
           (compared using ==)
    ```
    
    which shows that symbols were indeed not reconstructed properly.
    cboos committed May 19, 2018
    Copy the full SHA
    db00597 View commit details
    Browse the repository at this point in the history
  2. Add support for quoted symbols in ConstantHandler

    Constants containing quoted symbols can now be documented
    correctly.
    
    Prior to the fix, the value `:"sym+bol"` would be shown as `sym+bol`
    and worse, the empty symbol (`:''`) would have triggered an error in
    MethodHelper#format_constant.
    cboos committed May 19, 2018
    Copy the full SHA
    5b1dc8a View commit details
    Browse the repository at this point in the history
  3. Fix parsing of constants

    The sequence `:symbeg`, `:ident` (corresponding to symbols like `:ident`)
    also needs to be taken into account.
    cboos committed May 19, 2018
    Copy the full SHA
    4fa86f3 View commit details
    Browse the repository at this point in the history