From adbb930fe5d72aa56789053d7aa3dfd7a1e1df36 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 19 Mar 2009 13:22:46 +0000 Subject: [PATCH] fixed broken syntax error checks svn: r14187 original commit: afc5ad8d830ea484ee2eb5e4ad309e215ac95e67 --- collects/parser-tools/lex.ss | 3 +- collects/parser-tools/private-lex/actions.ss | 33 +++++++++----------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/collects/parser-tools/lex.ss b/collects/parser-tools/lex.ss index 4aceb59..7613ecc 100644 --- a/collects/parser-tools/lex.ss +++ b/collects/parser-tools/lex.ss @@ -81,7 +81,8 @@ (((special) act) (not (ormap (lambda (x) - (module-or-top-identifier=? (syntax special) x)) + (and (identifier? #'special) + (module-or-top-identifier=? (syntax special) x))) ids))) (_ #t))) spec/re-act-lst)) diff --git a/collects/parser-tools/private-lex/actions.ss b/collects/parser-tools/private-lex/actions.ss index 10330a8..6ec0c7f 100644 --- a/collects/parser-tools/private-lex/actions.ss +++ b/collects/parser-tools/private-lex/actions.ss @@ -1,19 +1,16 @@ -(module actions mzscheme - (provide (all-defined)) - (require syntax/stx) - - ;; get-special-action: (syntax-object list) syntax-object syntax-object -> syntax-object - ;; Returns the first action from a rule of the form ((which-special) action) - (define (get-special-action rules which-special none) - (cond - ((null? rules) none) - (else - (syntax-case (car rules) () - (((special) act) - (module-or-top-identifier=? (syntax special) which-special) - (syntax act)) - (_ (get-special-action (cdr rules) which-special none)))))) - +#lang scheme/base - - ) +(provide (all-defined-out)) +(require syntax/stx) + +;; get-special-action: (syntax-object list) syntax-object syntax-object -> syntax-object +;; Returns the first action from a rule of the form ((which-special) action) +(define (get-special-action rules which-special none) + (cond + ((null? rules) none) + (else + (syntax-case (car rules) () + (((special) act) + (and (identifier? #'special) (module-or-top-identifier=? (syntax special) which-special)) + (syntax act)) + (_ (get-special-action (cdr rules) which-special none))))))