Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Produce UTS from `#lang resyntax/test`

オープン
#586 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
領域
tooling

調査の方向性

この issue ではファイルもテストも指定されていないため、まず #lang resyntax/test reader とその read-syntax 実装を見つけてください。その出力を、一覧にある UTS の要件および original-reader の UTS 要件と比較し、その後、reader が完成したと見なす前に、記載された未解決の質問を解決してください。

索引モデルが issue の本文から書いたものです。

説明

testing

The language's read-syntax implementation should produce Universal Tagged Syntax (UTS), which is my term for the kind of syntax objects I'm using to make Resyntax work on non-s-expression #langs. This implies a few restrictions:

  • The result of syntax-e anyways produces either an atom (a value with no syntax objects inside it) or a compound, which is a proper list of proper syntax objects.
  • Every list syntax object's first child is a shape tag, which is a keyword used to label the type of the surface syntax node.
  • Every atom has a 'uts-content syntax property whose value is a string. This is used as the textual form of the atom when writing the syntax object as text.
  • Every shape tag has a 'uts-separators syntax property whose value is a list of strings. The list should be equal to one plus the number of non-tag children in the tagged syntax object. This is combined with the textual forms of the child syntax objects when writing the tagged syntax object as text. The first separator is the prefix before the first child, the last separator is the suffix after the last child, and the middle separators are inserted between the children. The shape tags themselves are not written.

The one exception to the above is that the outermost syntax object returned by a #lang's reader is allowed to start with (module ...), with no shape tag. This is required for compatibility with Racket's #lang mechanism.

In addition to the above, a #lang's reader should produce original reader UTS, which is UTS where every syntax object is syntax-original? and where all syntax object source locations adhere to these rules:

  • Source locations never partially overlap.
  • One source location encloses another only when the first location's syntax object contains the second location's syntax object as a descendant.
  • One source location starting before another implies its syntax object comes before the other one's during a preorder traversal of the entire source file's syntax object.
  • Every syntax object's syntax-source value is the same and is in some way related to the original file or string containing the #lang directive.
  • Shape tags start at the same position as their parent syntax object and have a span of zero
  • Atoms have a uts-content string equal to the text at their source location in the original source code. Similarly, compounds have a uts-separators list whose strings are the substrings between its children, between the compound's start position and its first child's start, and between the compound's end position and its last child's end.
  • The syntax-span of a compound is equal to the spans of its children plus the total number of characters in the compound's uts-separators list.

Open questions include specifying how the #lang text should be reflected in the UTS properties, how autoformatting should work, how to detect comments, how indentation works, and probably lots of other stuff.

主要言語
Racket
スター
70
フォーク
11
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jackfirth/resyntax のほかの issue

jackfirth/resyntax の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。