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

"/*" interpreted as comment start even within a string. #68

Open
pranjalvachaspati-toast opened this issue Apr 6, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@pranjalvachaspati-toast
Copy link

For example, in

  public fun foo(
    argument1: String = "*/*",
    argument2: Map<String, String> = emptyMap(),
) {}

the "/*" in the argument1 default is treated as the beginning of a comment, and the rest of the code block is treated as a comment.

The Kotlin compiler does not treat it as a comment start, though (see https://pl.kotl.in/d9VnkkShu).

@nishtahir nishtahir added bug Something isn't working help wanted Extra attention is needed labels Apr 6, 2023
@steliosfran
Copy link

@nishtahir I was investigating the same issue today but didn't manage to fix it.

For some reason it only happens if this is within a function:

fun foo(argument: String = "image/*") {}

but not a val:

val foo = "image/*"

My initial assumption was that the issue is here:

patterns:
            -
                include: '#inline'
            -
                begin: '/\*'

because the begin clock does not check for double quotes, so I changed it to this begin: '(?<!")/\*' but the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants