From 83c83dd35002c3d5f3a65b483a545b7396d672ec Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 10 Nov 2016 15:51:51 -0800 Subject: [PATCH] rename more --- beautiful-racket/br/demo/jsonic/tokenizer.rkt | 2 +- brag/brag/support.rkt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/beautiful-racket/br/demo/jsonic/tokenizer.rkt b/beautiful-racket/br/demo/jsonic/tokenizer.rkt index 58f40b4..f7173b3 100644 --- a/beautiful-racket/br/demo/jsonic/tokenizer.rkt +++ b/beautiful-racket/br/demo/jsonic/tokenizer.rkt @@ -7,7 +7,7 @@ [(eof) eof] [(between "//" "\n") (next-token)] [(between "@$" "$@") - (token 'SEXP-TOK (trim-delimiters "@$" lexeme "$@"))] + (token 'SEXP-TOK (trim-ends "@$" lexeme "$@"))] [any-char (token 'CHAR-TOK lexeme)])) (our-lexer port)) next-token) diff --git a/brag/brag/support.rkt b/brag/brag/support.rkt index e0f4c94..74b4d2b 100755 --- a/brag/brag/support.rkt +++ b/brag/brag/support.rkt @@ -9,8 +9,8 @@ token [struct-out exn:fail:parsing] apply-tokenizer - trim-delimiters - delimited-by) + trim-ends + between) (struct token-struct (type val offset line column span skip?) @@ -50,10 +50,10 @@ (for/list ([token (in-producer token-producer eof)]) token)) -(define (trim-delimiters left lexeme right) +(define (trim-ends left lexeme right) (string-trim (string-trim lexeme left #:right? #f) right #:left? #f)) -(define-lex-trans delimited-by +(define-lex-trans between (λ(stx) (syntax-case stx () [(_ OPEN CLOSE)