Skip to content

Request Help on Fault Tolerance with read.ss #972

@ufo5260987423

Description

@ufo5260987423

Well, I'm fixing Scheme-langserver's crashes nowadays and one of the most important approach is to catch 79 lines of rd-error like

(xcall rd-error #f #t "invalid string character \\~c~c~c" c c1 c2)

In editor's general scenarios, properly processing them means fault tolerance technique to delete characters and preserve meaningful fragments in source codes as long as possible. For example, R7RS string "\123" may cause error and throw condition, and condition-irritants consists "invalid string character ...", #\\ character's position and other information. My current approach is to replace #\\ character with blank, so that other items in this altered source code will keep their position with origin and won't cause code editing inconsistent with language server indexing.
Here, my current approach is to step-by-step digest s/read.ss and patch downgrade rules to properly handle such rd-errors. And I want following helps:

  1. Is there any mature compatible solution with Chez's s/read.ss? If there is, I can be free from dozen of hard workings.
  2. Or, is there any theory publishes on "fault tolerant in lisp parser"? If there is, I can confirm that correctness my patch rules perform.
  3. Any other advises?
  4. Addition: apparently, s/read.ss is not initially designed for fault tolerance, could I say that my patches can't reach the ultimate end, in which position read procedure won't throw unknown errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions