Skip to content

Pressing 'B' at form-end skips intermediate forms #1

@carlinigraphy

Description

@carlinigraphy

Given the following scheme, with the cursor indicated as ^

(define (shunting-yard expr)
  (let loop ([expr (string->list expr)]
             [opstack '()]
             [result '()])
    (if (null? expr)
      (unshunt opstack result) ; jumps back to here
      (let ([head (car expr)]
            [tail (cdr expr)])
        (cond
          [(not (operator? head))
           (loop tail opstack (cons head result))]
          [(to-shunt? opstack head)
           (loop expr (cdr opstack) (cons (car opstack) result))]
          [else
            (loop tail (cons head opstack) result)])))))
                                                   ;^

There is no distinction made with the cursor on the closing paren of a form, as on the opening. As above, 'B' jumps the cursor to the prior overall form, skipping every intermediate form.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions