akeep / nanopass-framework-racket

Racket port of the nanopass-framework
MIT License
34 stars 9 forks source link

Support for DrRacket arrows and renaming #23

Open soegaard opened 9 years ago

soegaard commented 9 years ago

After syntax checking DrRacket supports some nice features:

Consider this program:

#lang nanopass
(define-language L
  (entry Expr)
  (terminals (number (r)))
  (Expr (e) r))

(with-output-language (L Expr) 1)

I would like to rename L but the renaming option is not available. In order to support renaming one has to add properties:

http://docs.racket-lang.org/tools/Check_Syntax.html?q=sub-binder#%28idx._%28gentag._28._%28lib._scribblings%2Ftools%2Ftools..scrbl%29%29%29

Note that if the property 'sub-range-binders is used then a renaming of L to M will also rename unparse-L to the unparse-M.

LeifAndersen commented 9 years ago

Yes, I am all up for adding these properties.

Although this does lead to the question of do we want to continue to strip the ? off of predicates in terminals?

(If we stop stripping them off we do get support for the arrows. Although if we don't, then we can just add the check syntax property's back.)

After playing with it a bit both ways I'm pretty ambivalent as it hasn't made much of an impact either way. Although whenever I describe nanopass to other people who have used racket they have complained to me about that.

soegaard commented 9 years ago

2015-07-11 23:26 GMT+02:00 Leif Andersen notifications@github.com:

Yes, I am all up for adding these properties.

Although this does lead to the question of do we want to continue to strip the ? off of predicates in terminals?

(If we stop stripping them off we do get support for the arrows. Although if we don't, then we can just add the check syntax property's back.)

Both would work.

After playing with it a bit both ways I'm pretty ambivalent as it hasn't made much of an impact either way. Although whenever I describe nanopass to other people who have used racket they have complained to me about that.

Complained about which part?

/Jens Axel

LeifAndersen commented 9 years ago

Complained about which part?

Complained about the question marks disappearing. (They would rather the full predicate be there.) So it would look like:

(define-language L0 (terminals (symbol? (x))))

Although I'm good either way.

Anyway, PR# 31 does deal with this issue. Although I wouldn't close it just yet. (As there is likely more arrows we wish to have.)

soegaard commented 2 years ago

@LeifAndersen Is it time to close it?