Skip to content

Implement #!fold-case / case-insensitive parsing (R7RS §2.1) #232

@aalpar

Description

@aalpar

Context

TODO at machine/compile_time_continuation.go:424:

// TODO: implement case-insensitive parsing by creating parser with caseInsensitive=true

Problem

R7RS §2.1 specifies #!fold-case and #!no-fold-case directives that control case sensitivity of subsequent identifiers. The parser already has a caseInsensitive parameter, but the compile-time continuation code that invokes the parser doesn't use it. This means #!fold-case has no effect at compile time.

Suggested approach

  1. Thread the case-sensitivity flag through the compile-time continuation's parser creation
  2. Ensure #!fold-case / #!no-fold-case directives toggle the flag during tokenization
  3. Add tests for case-folded identifiers in include and include-ci forms

R7RS reference

The directive #!fold-case causes subsequent identifiers and character names to be case-folded. The directive #!no-fold-case reverses the effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestplannedDesign complete, ready to start

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions