About the IMPORT instruction

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

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

評価

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

調査の方向性

The payload names no files, so start by finding the pre-parser and the IMPORT handling in the C# source. Read how the main file's configuration is applied to the merged text. Done would mean imported files are pre-parsed recursively with their own configuration, syntax errors report the correct file and line, and the grammar reads are merged before the main parse. The issue is a design proposal with no maintainer decision, so confirm the approach in the thread before writing code.

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

説明

bug invalid

What we have now

The pre-parsing applies on the main file. For each IMPORT read, it deletes that import and add the imported content to the start of the new string to parse.

The problem

Now if there is an error in one file, the parsing will still trigger an error, but it will neither give the file it occurs nor the correct line of the error. Moreover, different files may need different configurations. As for now, only the last line is taken into account for configuration, and that may lead to unexpected errors when parsing.

Idea for solution

Here is what I propose:

  1. When the pre-parser reads the main file, each time a IMPORT instruction is encountered
    1. The pre-parsing is also applied on the imported file, with a new empty configuration context so that the main configuration and the imported file configuration does not conflict. (Each time a IMPORT instruction is read, pre-parsing must recursively applied to the imported file).
    2. The syntax parsing is applied to the imported file.
  2. Once the pre-parsing is finished, all imported grammar reads are merged together
  3. The parsing can normally apply on the main file normally
主要言語
C#
スター
0
フォーク
0
平均マージ
3日 4時間
マージ済み PR(30日)
5

環境構築

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

はじめの一歩

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

Natvs/Nt.SyntaxParser のほかの issue

Natvs/Nt.SyntaxParser の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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