Skip to content

check-syntax: no arrow for sub-range-binders when the bound occurrence is inside syntax #399

Open
@sorawee

Description

@sorawee

Consider:

#lang racket

(define-syntax (m stx)
  (syntax-case stx ()
    [(_ id1)
     (identifier? #'id1)
     (syntax-property
      #'1
      'disappeared-binding (list (syntax-local-introduce #'id1)))]))
 
(m a)

(syntax a)

Check Syntax is able to draw an arrow from a in m to a in syntax correctly.

Now, consider:

#lang racket

(define-syntax (define* stx)
  (syntax-case stx ()
    [(_ id1)
     (let ()
       (define first-part (symbol->string (syntax-e #'id1)))
       (define first-len (string-length first-part))
       (define new-id
         (datum->syntax
          #'id1
          (string->symbol (string-append first-part "*"))))
       (syntax-property
        #`(define #,new-id 1)
        'sub-range-binders
        (list
         (vector (syntax-local-introduce new-id)
                 0 first-len 0.5 0.5
                 (syntax-local-introduce #'id1)
                 0 first-len 0.5 0.5))))]))
 
(define* big)
(syntax big*)
big*

While Check Syntax is able to draw an arrow from big to the second big*, it is unable to draw an arrow to the first big*, which is inside syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcheck-syntaxissues related to check-syntax, background expansion, drawing nifty arrows, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions