From f5b300f6d1a420993aee9833f904b9a0a89d498b Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 21 Jun 2018 17:55:00 -0700 Subject: [PATCH] delete unneeded `eof` rules --- beautiful-racket-demo/basic-demo-2/lexer.rkt | 1 - beautiful-racket-demo/basic-demo-2a/lexer.rkt | 1 - beautiful-racket-demo/basic-demo-3/lexer.rkt | 1 - beautiful-racket-demo/basic-demo-nth/tokenizer.rkt | 1 - beautiful-racket-demo/basic-demo/lexer.rkt | 1 - beautiful-racket-demo/bf-demo/reader.rkt | 1 - beautiful-racket-demo/bf-demo/test-tokenizer.rkt | 3 +-- beautiful-racket-demo/hdl-demo/tokenizer.rkt | 1 - beautiful-racket-demo/hdl-tst-demo/tokenizer.rkt | 1 - beautiful-racket-demo/jsonic-demo-2/tokenizer.rkt | 1 - beautiful-racket-demo/jsonic-demo-3/tokenizer.rkt | 1 - beautiful-racket-demo/jsonic-demo/tokenizer.rkt | 1 - beautiful-racket-demo/txtadv-demo/tokenizer.rkt | 1 - 13 files changed, 1 insertion(+), 14 deletions(-) diff --git a/beautiful-racket-demo/basic-demo-2/lexer.rkt b/beautiful-racket-demo/basic-demo-2/lexer.rkt index e5f6456..df078a4 100644 --- a/beautiful-racket-demo/basic-demo-2/lexer.rkt +++ b/beautiful-racket-demo/basic-demo-2/lexer.rkt @@ -7,7 +7,6 @@ (define basic-lexer (lexer-srcloc - [(eof) (return-without-srcloc eof)] ["\n" (token 'NEWLINE lexeme)] [whitespace (token lexeme #:skip? #t)] [(from/stop-before "rem" "\n") (token 'REM lexeme)] diff --git a/beautiful-racket-demo/basic-demo-2a/lexer.rkt b/beautiful-racket-demo/basic-demo-2a/lexer.rkt index 9f95c19..95b0bef 100644 --- a/beautiful-racket-demo/basic-demo-2a/lexer.rkt +++ b/beautiful-racket-demo/basic-demo-2a/lexer.rkt @@ -5,7 +5,6 @@ (define basic-lexer (lexer-srcloc - [(eof) (return-without-srcloc eof)] ["\n" (token 'NEWLINE lexeme)] [whitespace (token lexeme #:skip? #t)] [(from/stop-before "rem" "\n") (token 'REM lexeme)] diff --git a/beautiful-racket-demo/basic-demo-3/lexer.rkt b/beautiful-racket-demo/basic-demo-3/lexer.rkt index b3365f5..034f056 100644 --- a/beautiful-racket-demo/basic-demo-3/lexer.rkt +++ b/beautiful-racket-demo/basic-demo-3/lexer.rkt @@ -10,7 +10,6 @@ (define basic-lexer (lexer-srcloc - [(eof) (return-without-srcloc eof)] ["\n" (token 'NEWLINE lexeme)] [whitespace (token lexeme #:skip? #t)] [(from/stop-before "rem" "\n") (token 'REM lexeme)] diff --git a/beautiful-racket-demo/basic-demo-nth/tokenizer.rkt b/beautiful-racket-demo/basic-demo-nth/tokenizer.rkt index d07620c..6715247 100644 --- a/beautiful-racket-demo/basic-demo-nth/tokenizer.rkt +++ b/beautiful-racket-demo/basic-demo-nth/tokenizer.rkt @@ -10,7 +10,6 @@ (define basic-lexer (lexer-src-pos - [(eof) eof] [whitespace (token 'WHITE lexeme #:skip? #t #:position (pos lexeme-start) #:line (line lexeme-start) diff --git a/beautiful-racket-demo/basic-demo/lexer.rkt b/beautiful-racket-demo/basic-demo/lexer.rkt index 9f95c19..95b0bef 100644 --- a/beautiful-racket-demo/basic-demo/lexer.rkt +++ b/beautiful-racket-demo/basic-demo/lexer.rkt @@ -5,7 +5,6 @@ (define basic-lexer (lexer-srcloc - [(eof) (return-without-srcloc eof)] ["\n" (token 'NEWLINE lexeme)] [whitespace (token lexeme #:skip? #t)] [(from/stop-before "rem" "\n") (token 'REM lexeme)] diff --git a/beautiful-racket-demo/bf-demo/reader.rkt b/beautiful-racket-demo/bf-demo/reader.rkt index 008a537..9329a32 100644 --- a/beautiful-racket-demo/bf-demo/reader.rkt +++ b/beautiful-racket-demo/bf-demo/reader.rkt @@ -13,7 +13,6 @@ (define (next-token) (define bf-lexer (lexer - [(eof) eof] [(char-set "><-.,+[]") lexeme] [any-char (next-token)])) (bf-lexer port)) diff --git a/beautiful-racket-demo/bf-demo/test-tokenizer.rkt b/beautiful-racket-demo/bf-demo/test-tokenizer.rkt index 109c630..3fca1af 100644 --- a/beautiful-racket-demo/bf-demo/test-tokenizer.rkt +++ b/beautiful-racket-demo/bf-demo/test-tokenizer.rkt @@ -10,8 +10,7 @@ #;[(:: "#" (:* (complement "\n")) "\n") (token 'comment #:skip? #t)] [whitespace (token 'white #:skip? #t)] ;; treat other characters as comments - [(char-range #\nul #\~) (token 'ascii #:skip? #t)] - [(eof) eof])) + [(char-range #\nul #\~) (token 'ascii #:skip? #t)])) (define (next-token) (get-token ip)) diff --git a/beautiful-racket-demo/hdl-demo/tokenizer.rkt b/beautiful-racket-demo/hdl-demo/tokenizer.rkt index 2bc272c..5b127de 100644 --- a/beautiful-racket-demo/hdl-demo/tokenizer.rkt +++ b/beautiful-racket-demo/hdl-demo/tokenizer.rkt @@ -7,7 +7,6 @@ (define (next-token) (define get-token (lexer-src-pos - [(eof) eof] [(union (:seq "/*" (complement (:seq any-string "*/" any-string)) "*/") (:seq "//" (repetition 1 +inf.0 (char-complement #\newline)) #\newline)) diff --git a/beautiful-racket-demo/hdl-tst-demo/tokenizer.rkt b/beautiful-racket-demo/hdl-tst-demo/tokenizer.rkt index 9e2292b..64e9a5e 100644 --- a/beautiful-racket-demo/hdl-tst-demo/tokenizer.rkt +++ b/beautiful-racket-demo/hdl-tst-demo/tokenizer.rkt @@ -4,7 +4,6 @@ (define hdl-test-lexer (lexer-srcloc - [(eof) eof] [(:or (from/to "/*" "*/") (from/to "//" #\newline)) (token 'COMMENT lexeme #:skip? #t)] [whitespace (token lexeme #:skip? #t)] diff --git a/beautiful-racket-demo/jsonic-demo-2/tokenizer.rkt b/beautiful-racket-demo/jsonic-demo-2/tokenizer.rkt index 3d534fe..4d281ca 100644 --- a/beautiful-racket-demo/jsonic-demo-2/tokenizer.rkt +++ b/beautiful-racket-demo/jsonic-demo-2/tokenizer.rkt @@ -18,7 +18,6 @@ (define (next-token) (define jsonic-lexer (lexer - [(eof) eof] [(from/to "//" "\n") (next-token)] [(from/to "@$" "$@") (token 'SEXP-TOK (trim-ends "@$" lexeme "$@") diff --git a/beautiful-racket-demo/jsonic-demo-3/tokenizer.rkt b/beautiful-racket-demo/jsonic-demo-3/tokenizer.rkt index 995c833..bd4e405 100644 --- a/beautiful-racket-demo/jsonic-demo-3/tokenizer.rkt +++ b/beautiful-racket-demo/jsonic-demo-3/tokenizer.rkt @@ -18,7 +18,6 @@ (define (next-token) (define jsonic-lexer (lexer - [(eof) eof] [(from/to "//" "\n") (next-token)] [(from/to "@$" "$@") (token 'SEXP-TOK (trim-ends "@$" lexeme "$@") diff --git a/beautiful-racket-demo/jsonic-demo/tokenizer.rkt b/beautiful-racket-demo/jsonic-demo/tokenizer.rkt index 2565599..f3d2453 100644 --- a/beautiful-racket-demo/jsonic-demo/tokenizer.rkt +++ b/beautiful-racket-demo/jsonic-demo/tokenizer.rkt @@ -5,7 +5,6 @@ (define (next-token) (define jsonic-lexer (lexer - [(eof) eof] [(from/to "//" "\n") (next-token)] [(from/to "@$" "$@") (token 'SEXP-TOK (trim-ends "@$" lexeme "$@"))] diff --git a/beautiful-racket-demo/txtadv-demo/tokenizer.rkt b/beautiful-racket-demo/txtadv-demo/tokenizer.rkt index 2001188..bdebbb0 100644 --- a/beautiful-racket-demo/txtadv-demo/tokenizer.rkt +++ b/beautiful-racket-demo/txtadv-demo/tokenizer.rkt @@ -7,7 +7,6 @@ (define (next-token) (define get-token (lexer - [(eof) eof] [(union (:seq "/*" (complement (:seq any-string "*/" any-string)) "*/") (:seq "//" (repetition 1 +inf.0 (char-complement #\newline)) #\newline))