About the IMPORT instruction

Aberta
#29 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
20/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
csharp
Domínio
compilers

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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
Linguagem predominante
C#
Estrelas
0
Forks
0
Merge médio
3d 4h
PRs com merge (30d)
5

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Natvs/Nt.SyntaxParser

Todas as issues de Natvs/Nt.SyntaxParser

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.