Unbreak syntax/to-string tests

It's still unclear what the specification of syntax->string regarding whitespace
before closing parens should be. The implementation also has not dealt with
the issue. This PR therefore removes whitespace before closing parens from
the tests.

Once the discussion at
https://github.com/racket/racket/issues/3071#issuecomment-601984438
has reached a conclusion and implemented, we can add these tests back.
This commit is contained in:
Sorawee Porncharoenwase 2020-03-22 16:34:20 -07:00 committed by Sam Tobin-Hochstadt
parent d9c064d06c
commit 3c966bc297
2 changed files with 42 additions and 40 deletions

View File

@ -119,5 +119,3 @@
(check-equal? (syntax->string #'(( unsyntax-splicing . a))) "( unsyntax-splicing . a)") (check-equal? (syntax->string #'(( unsyntax-splicing . a))) "( unsyntax-splicing . a)")
(check-equal? (syntax->string #'((unsyntax-splicing a b . c))) "(unsyntax-splicing a b . c)") (check-equal? (syntax->string #'((unsyntax-splicing a b . c))) "(unsyntax-splicing a b . c)")
(check-equal? (syntax->string #'(( unsyntax-splicing a b . c))) "( unsyntax-splicing a b . c)") (check-equal? (syntax->string #'(( unsyntax-splicing a b . c))) "( unsyntax-splicing a b . c)")

View File

@ -64,6 +64,10 @@
(hash-has-key? quotes-table (syntax-e (car (syntax-e c)))) (hash-has-key? quotes-table (syntax-e (car (syntax-e c))))
(eq? (syntax-span (car (syntax-e c))) (eq? (syntax-span (car (syntax-e c)))
(string-length (get-quote c)))) (string-length (get-quote c))))
;; The above conditions detect the shorthand form of quote and friends
;; The shorthand form will read, for instance, '<form>
;; as (quote <form>), so the result is guaranteed to be a syntax list
;; with exactly two elements in it.
(advance c init-line!) (advance c init-line!)
(printf (get-quote c)) (printf (get-quote c))
(set! col (+ col (string-length (get-quote c)))) (set! col (+ col (string-length (get-quote c))))