diff --git a/collects/parser-tools/lex.ss b/collects/parser-tools/lex.ss index 52b5b5d..c1ca19e 100644 --- a/collects/parser-tools/lex.ss +++ b/collects/parser-tools/lex.ss @@ -98,6 +98,8 @@ name-lst))) (let-values (((trans start action-names no-look disappeared-uses) (build-lexer re-actname-lst))) + #;(when (vector-ref action-names start) + (raise-syntax-error #f "accepts the empty string" stx)) (with-syntax ((start-state-stx start) (trans-table-stx trans) (no-lookahead-stx no-look) @@ -249,7 +251,7 @@ ;; including the one just read (length-chars 1) ;; how many characters are in the longest match - (longest-match-length 1)) + (longest-match-length 0)) (let ((next-state (cond ((eof-object? char) #f) diff --git a/collects/parser-tools/private-lex/deriv.ss b/collects/parser-tools/private-lex/deriv.ss index 84ae825..0f025f2 100644 --- a/collects/parser-tools/private-lex/deriv.ss +++ b/collects/parser-tools/private-lex/deriv.ss @@ -334,5 +334,6 @@ (define t13 (build-test-dfa `((intersection (concatenation (intersection) "111" (intersection)) (complement (union (concatenation (intersection) "01") (repeat 1 +inf.0 "1"))))))) + (define t14 (build-test-dfa `((complement "1")))) |# ) \ No newline at end of file diff --git a/collects/parser-tools/private-lex/util.ss b/collects/parser-tools/private-lex/util.ss index 13878b0..0448ca3 100644 --- a/collects/parser-tools/private-lex/util.ss +++ b/collects/parser-tools/private-lex/util.ss @@ -107,6 +107,5 @@ null) '(5 1 2 3 4 1 2 3 2 1))) - )