racket / rhombus

Rhombus programming language
Other
350 stars 62 forks source link

identify some identifiers as to-be-ignored by check syntax #491

Closed rfindler closed 7 months ago

rfindler commented 7 months ago

This makes some of the identifiers that were making the giant green blobs invisible to Check Syntax and seems to avoid the ones show in #489. I'm not sure if this is right, however. It also seems to get #%parens sometimes and maybe some others.

If you want to try it out, you'll need this recent commit to DrRacket.

In this example:

def op = 5
'+'

we still get the arrow.

In this example:

def parens = 5
'(abc,

  def,

  ghi,

  jkl)'

we don't anymore.

I also notice when playing around, that there are some #%body that are being ignored, but the ones I saw didn't have source locations.

Overall, I'm very not sure this is the right change!

related to #489

rfindler commented 7 months ago

Also, in this example:

#lang rhombus/and_meta

'abc(fun (v):
       if 1 = 2
       | 3
       | 4)'

we don't get the big blob anymore (I think all of the blocks are hidden) and the purple arrows we get from the lang line to the syntax constant are to fun, if, and =.

mflatt commented 7 months ago

Thanks! I do see that this change only covers some keyword-like identifiers. I'm happy to work on filling this out to take advantage of the new property.

rfindler commented 7 months ago

Thanks! I wasn't sure if I got them all and also worried that I got too many! I wondered about this spot in the lexer, whether it should also get this treatment. But I noticed that it goes on strings too, which probably isn't what we want.

mflatt commented 7 months ago

Updated to complete the change.