[feature request] More direct source line mapping

Offen
#141 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
lua
Bereich
compilers

Rechercherichtung

Das Issue nennt keine Quelldatei, keinen Test und keinen Einstiegspunkt. Beginne damit, die bestehenden Lua-Kommentare pro Zeile und das Verhalten zur Zeilenerhaltung des Compilers nachzuverfolgen; abgeschlossen ist die Aufgabe, wenn eine Option Lua-Zeilenzuordnungen erzeugt, die direkt den Yuescript-Zeilen entsprechen, einschließlich leerer Zeilen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Lua
Sterne
620
Forks
45
Ø Merge
9 Std. 5 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus IppClub/YueScript

Alle Issues in IppClub/YueScript

Ähnliche Issues

Weitere Issues zu Lua

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.