← 输入框|github.com|刷新
Skip to content

Fix tag element regex #170

Open
Open

Description

@hinerm

The tagElementSeparator pattern currently splits unpaired single quotes ('). As single quotes are often used as apostrophes, this results in a sentence like "The FunctionalInterface's method" being split to two elements, which then causes the op parser to barf because it thinks it has extra param annotations, or is missing its return annotation, etc...

Activity

  1. added this to the 1.0.0 milestone on Dec 14, 2023
  2. self-assigned this
    on Dec 14, 2023
  3. ctrueden commented on Dec 14, 2023

    @ctrueden
    Member

    If only there were some kind of proper parser instead of relying on a fragile regex here...? 🤡

  4. hinerm commented on Dec 18, 2023

    @hinerm
    MemberAuthor

    I tried looking at this and my first thought was the trailing [^']* should just be .* so that the pattern doesn't stop at singleton '. But then it starts failing on any multi-line @param.

    i.e.

    This op no longer compiles with this patch:

    -               "\\s*[,\\s]+(?=(?:[^']*'[^']*')*[^']*$)");
    +               "\\s*[,\\s]+(?=(?:[^']*'[^']*')*.*$)");
    

    I find this concerning and am skeptical we are parsing what we think we are, particularly for any multi-line javadoc. But it works right now so I also don't know that fiddling with this regex is useful right now.

  5. modified the milestones: 1.0.0, unscheduled on Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions