Skip to content

Type explainer can't parse methods ending in '?' and '!' #1077

@backus

Description

@backus

It would be nice to be able to document methods as @param foo [#all?] but the type explainer currently fails on methods like this. I realize it is really hard to parse ruby methods so I'm definitely not asking for something comprehensive, but adding ? and ! would be nice.

Steps to reproduce

$ irb
>> require 'yard'
>> YARD::Tags::TypesExplainer::Parser.parse('#all?')
SyntaxError: invalid character at ?
from /Users/johnbackus/.gem/ruby/2.3.1/gems/yard-0.9.8/lib/yard/tags/types_explainer.rb:154:in `block in parse'
>> YARD::Tags::TypesExplainer::Parser.parse('#gsub!')
SyntaxError: invalid character at !
from /Users/johnbackus/.gem/ruby/2.3.1/gems/yard-0.9.8/lib/yard/tags/types_explainer.rb:154:in `block in parse'

I would be happy to do a PR fixing this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions