From f4d9e18360d14e028a805bd64606efe44ed46b06 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 21 Jun 2012 01:54:23 -0400 Subject: [PATCH] Random pickiness. Spaces at EOFs, indentation, etc. original commit: 7d6e79023cf9872e6f6af2f89961b742c6296f1d --- collects/parser-tools/lex.rkt | 4 ++-- collects/parser-tools/private-lex/unicode-chars.rkt | 10 ++++------ .../parser-tools/private-yacc/input-file-parser.rkt | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/collects/parser-tools/lex.rkt b/collects/parser-tools/lex.rkt index d711808..cc4f393 100644 --- a/collects/parser-tools/lex.rkt +++ b/collects/parser-tools/lex.rkt @@ -315,9 +315,9 @@ (let ((match (read-string longest-match-length lb))) ;(printf "(read-string ~e port) = ~e\n" longest-match-length match) (do-match lb first-pos longest-match-action match))) - + (define file-path (make-parameter #f)) - + (define (do-match ip first-pos action value) #;(printf "(action ~a ~a ~a ~a)\n" (position-offset first-pos) (position-offset (get-position ip)) value ip) diff --git a/collects/parser-tools/private-lex/unicode-chars.rkt b/collects/parser-tools/private-lex/unicode-chars.rkt index 3177bb5..457aaf5 100644 --- a/collects/parser-tools/private-lex/unicode-chars.rkt +++ b/collects/parser-tools/private-lex/unicode-chars.rkt @@ -37,8 +37,7 @@ (cons (cons range-start (sub1 i)) (loop i (add1 i) #f))) (else (loop i (add1 i) #t)))))))))) - - + (define (compute-ranges x?) (delay (get-chars-for (lambda (x) (x? (integer->char x))) mapped-chars))) @@ -54,10 +53,9 @@ (define blank-ranges (compute-ranges char-blank?)) ;; 9 #;(define hexadecimal-ranges (compute-ranges char-hexadecimal?)) (define iso-control-ranges (compute-ranges char-iso-control?)) ;; 2 - - - - + + + (test-block () ((get-chars-for odd? '()) '()) ((get-chars-for odd? '((1 4 #f) (8 13 #f))) '((1 . 1) (3 . 3) (9 . 9) (11 . 11) (13 . 13))) diff --git a/collects/parser-tools/private-yacc/input-file-parser.rkt b/collects/parser-tools/private-yacc/input-file-parser.rkt index 68accf4..521bddc 100644 --- a/collects/parser-tools/private-yacc/input-file-parser.rkt +++ b/collects/parser-tools/private-yacc/input-file-parser.rkt @@ -122,7 +122,7 @@ end)) (syntax-e end)) ends)) - + ;; Get the list of terminals out of input-terms (list-of-non-terms