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

highlight issue #14

Open
diorw opened this issue Oct 8, 2017 · 3 comments
Open

highlight issue #14

diorw opened this issue Oct 8, 2017 · 3 comments

Comments

@diorw
Copy link

diorw commented Oct 8, 2017

while ( index < items.size) {
println("item at $index is ${items[index]}")
index++
}
fun

if there is no " " between index and '<' ,the program behind them will not be highlight correctly.
The string "fun" is still white,but purple is right.
Is it a issue or this kind of syntax (index<items.size) is not allowed?

@retinaburn
Copy link
Contributor

Appears to be related to the <. > does not produce the same results. I suspect it has something to do with generics...

fun main(args: Array<String>) {
    1>2
    //1<2 //fails highlighting
    var test1 = 1 < 2
    var test2 = 1< 2 //also fails highlighting
    println("Hello, World!")
    println("Test1: $test1");
    println("Test2: $test2");
}

@retinaburn
Copy link
Contributor

Looks like the this might be the type definition that is causing the problem, line 131 looks like it is defining a type ..but we don't want to do it for expressions ..hmmm

 types:
  patterns: 
   <---snip--->
    {
      begin: "\\w+<"
      end: ">"
      patterns: [
        {
          include: "#types"
        }
        {
          include: "#keywords"
        }
      ]
    }

@retinaburn
Copy link
Contributor

I have a fix, but I am not sure what exactly is impacted by this fix. I can't figure out what I am breaking by making this change :)

    # {
    #   begin: "\\w+<"
    #   end: ">"
    #   patterns: [
    #     {
    #       include: "#types"
    #     }
    #     {
    #       include: "#keywords"
    #     }
    #   ]
    # }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants