[feature request] More direct source line mapping

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
lua
領域
compilers

調査の方向性

Issue にはソースファイル、テスト、エントリーポイントのいずれも記載されていません。まず、コンパイラに既存の行ごとの Lua コメントと行保持の動作を追跡します。完了の条件は、オプションによって Yuescript の行と直接一致する Lua の行マッピングが生成され、空行も含まれることです。

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

説明

Since the compiler can already append a comment to each Lua line saying what Yuescript line it came from, it would be nice if there were an option to instead just put all Lua code on the same line as the Yuescript code that produced it, as well as preserving empty lines.

For example, the code:

1| x = if this
2|     foo()
3| 
4| else
5|     bar()

would be compiled like this:

1| local x
2| if this then
3|     x = foo()
4| else
5|     x = bar()
6| end

My suggestion would be to allow for it to be compiled to something more like this:

1| local x; if this then
2|     x = foo()
3| 
4| else
5|     x = bar(); end

The goal is to make line numbers in tracebacks and debugging info map directly to their according Yuescript line, meaning that it would no longer be necessary to first look which Lua line the error occurred on and then go to the Yuescript line that produced it. Instead, we could simply go to the error line directly in the Yuescript file.

主要言語
Lua
スター
620
フォーク
45
平均マージ
9時間 5分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

IppClub/YueScript のほかの issue

IppClub/YueScript の issue をすべて見る

似ている issue

Lua の issue をもっと見る

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

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