#16 Parser does not handle delimiters correctly


Missing whitespace between alphanumeric characters and quotes leads to a error "unbound variable".

Example to reproduce:

(define a 5)
(eval '(list "abc" a"xyz"))

Note the missing space between a and "xyz".

Tested against CVS HEAD (scheme.c at revision 1.35).

r5rs definition is strange here ("Tokens which require implicit termination (identifiers, numbers, characters, and dot) may be terminated by any <delimiter> .."), but the quote is explicitely not in the set of valid identifier characters. So the error "unbound variable" is definitely not correct


  • Kevin Cozens

    Kevin Cozens - 2011-02-06
    • summary: Parser does handle delimiters correctly --> Parser does not handle delimiters correctly
  • Kevin Cozens

    Kevin Cozens - 2012-11-06

    The R5RS definition referenced in the problem statement is from section 2.2 (Whitespace and comments) on page 5 of the R5RS document. The definition may seem strange but section 7.1.1 (Lexical structure) which starts on page 38 clearly lists delimiters as whitespace, (, ), ", and ;. The double quote would terminate the identifier that started with 'a'.

    A simpler way to reproduce the error is with (list 1"2").
    Note there is no space between 1 and the double quote mark.

  • Kevin Cozens

    Kevin Cozens - 2012-11-06
    • status: open --> closed-fixed
  • Kevin Cozens

    Kevin Cozens - 2012-11-06

    I commited a fix which adds extra characters to the set of delimeters when reading strings for atoms. TinyScheme now handles the example cases given in this report. There might be some other cases with delimiters that are not properly handled. I'm leaving comment posting open in case other related parsing issues are discovered that might require this case to be reopened.

    Fix commited as revision 91.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks