Conversation
- Now every .pln file compiled generates a .ptf file along with the target one - There isnow an option to only print the types, generating no files
Member
|
Qual é a diferença entre aquelas funções lá do type_extractor e coisas como a types.tostring do types.T? |
Contributor
Author
Há algumas:
Em suma, |
Member
|
Ok! Acho que seria uma boa ideia falar disso num comentário no código.Em 19 de nov. de 2025 3:24 PM, Igor de Araujo Vilhalba ***@***.***> escreveu:igrvlhlb left a comment (pallene-lang/pallene#654)
Qual é a diferença entre aquelas funções lá do type_extractor e coisas como a types.tostring do types.T?
Há algumas:
ao passar uma função types.tostring() a saída é function <paramtypes> -> <rettypes>; no type_extractor nós geramos a representação ( <paramtypes> ) -> <rettypes> (parênteses opcionais a depender da quantidade de parâmetros)os campos das tables não são ordenados para impressão no type_extractorem types.tostring(), ao receber um Record, a saída é só seu nome. No type_extractor imprimimos seus nomes de campos e respectivos tiposEm types.tostring(), ao receber um tipo Alias, fiz com que a saída fosse <nominal> [aka <actual>], enquanto que em type_extractor a saída é o próprio nome do alias.
Em suma, types.tostring() tem uma saída mais expressiva, pensada para mensagens para o usuário, por exemplo, enquanto type_extractor tem uma saída que tenta replicar a sintaxe de declaração de tipos em Pallene.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Contributor
Author
@hugomg feito! Aproveitei e subi a mudança da extensão do arquivo de tipos: |
hugomg
approved these changes
Nov 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for extracting and displaying type declarations for Pallene modules. The main changes introduce a new
.ptfoutput file containing type information for exported names, and a new--print-typescommand-line flag. Supporting code and test updates ensure.ptffiles are generated propperly.Type extraction and output support:
src/pallene/type_extractor.luathat generates type declarations for exported names in Pallene modules.src/pallene/driver.luato support compiling.plnfiles to.ptffiles and to invoke type extraction when building shared objects. [1] [2] [3] [4] [5]Command-line and test integration:
--print-typesflag to the Pallene compiler CLI (src/pallene/pallenec.lua), allowing users to print type information to stdout. [1] [2] [3] [4].ptffile creation and clean up.ptffiles after test runs. [1] [2] [3] [4] [5]