Request Help on Fault Tolerance with `read.ss`

Open
#972 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Domain
backend

Research direction

The issue discusses making s/read.ss fault tolerant and asks for parser design guidance. Start by reading s/read.ss and the described rd-error handling; the issue does not name tests or a specific change. Done would require a defined fault-tolerance approach and criteria for handling malformed input without unexpected reader errors.

Written by the indexing model from the issue text.

Description

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.
Dominant language
Scheme
Stars
7.4k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
19

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cisco/ChezScheme

All issues in cisco/ChezScheme

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.