@designliquido/delegua 1.26.1 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/avaliador-sintatico/avaliador-sintatico.d.ts +25 -0
- package/avaliador-sintatico/avaliador-sintatico.d.ts.map +1 -1
- package/avaliador-sintatico/avaliador-sintatico.js +95 -6
- package/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/bibliotecas/dialetos/pitugues/primitivas-dicionario.js +3 -3
- package/bibliotecas/dialetos/pitugues/primitivas-dicionario.js.map +1 -1
- package/bibliotecas/dialetos/pitugues/primitivas-numero.js +2 -2
- package/bibliotecas/dialetos/pitugues/primitivas-numero.js.map +1 -1
- package/bibliotecas/dialetos/pitugues/primitivas-texto.js +17 -17
- package/bibliotecas/dialetos/pitugues/primitivas-texto.js.map +1 -1
- package/bibliotecas/dialetos/pitugues/primitivas-vetor.js +13 -13
- package/bibliotecas/dialetos/pitugues/primitivas-vetor.js.map +1 -1
- package/bin/package.json +2 -2
- package/interfaces/simbolo-interface.d.ts +1 -0
- package/interfaces/simbolo-interface.d.ts.map +1 -1
- package/interpretador/interpretador.d.ts +1 -1
- package/interpretador/interpretador.d.ts.map +1 -1
- package/interpretador/interpretador.js +12 -3
- package/interpretador/interpretador.js.map +1 -1
- package/lexador/lexador-base.d.ts +1 -1
- package/lexador/lexador-base.d.ts.map +1 -1
- package/lexador/lexador-base.js +2 -2
- package/lexador/lexador-base.js.map +1 -1
- package/lexador/lexador.d.ts +1 -1
- package/lexador/lexador.d.ts.map +1 -1
- package/lexador/lexador.js +3 -3
- package/lexador/lexador.js.map +1 -1
- package/lexador/simbolo.d.ts +2 -1
- package/lexador/simbolo.d.ts.map +1 -1
- package/lexador/simbolo.js +2 -1
- package/lexador/simbolo.js.map +1 -1
- package/package.json +2 -2
- package/tradutores/index.d.ts +0 -4
- package/tradutores/index.d.ts.map +1 -1
- package/tradutores/index.js +0 -4
- package/tradutores/index.js.map +1 -1
- package/tradutores/tradutor-elixir.d.ts +17 -0
- package/tradutores/tradutor-elixir.d.ts.map +1 -1
- package/tradutores/tradutor-elixir.js +82 -2
- package/tradutores/tradutor-elixir.js.map +1 -1
- package/tradutores/tradutor-javascript.d.ts +1 -1
- package/tradutores/tradutor-javascript.d.ts.map +1 -1
- package/tradutores/tradutor-javascript.js +12 -0
- package/tradutores/tradutor-javascript.js.map +1 -1
- package/tradutores/tradutor-python.d.ts +8 -0
- package/tradutores/tradutor-python.d.ts.map +1 -1
- package/tradutores/tradutor-python.js +40 -4
- package/tradutores/tradutor-python.js.map +1 -1
- package/tradutores/tradutor-reverso-javascript.d.ts.map +1 -1
- package/tradutores/tradutor-reverso-javascript.js +3 -0
- package/tradutores/tradutor-reverso-javascript.js.map +1 -1
- package/tradutores/tradutor-ruby.d.ts.map +1 -1
- package/tradutores/tradutor-ruby.js +5 -0
- package/tradutores/tradutor-ruby.js.map +1 -1
- package/umd/delegua.js +502 -3334
- package/tradutores/tradutor-assembly-arm.d.ts +0 -98
- package/tradutores/tradutor-assembly-arm.d.ts.map +0 -1
- package/tradutores/tradutor-assembly-arm.js +0 -711
- package/tradutores/tradutor-assembly-arm.js.map +0 -1
- package/tradutores/tradutor-assembly-risc-v.d.ts +0 -100
- package/tradutores/tradutor-assembly-risc-v.d.ts.map +0 -1
- package/tradutores/tradutor-assembly-risc-v.js +0 -688
- package/tradutores/tradutor-assembly-risc-v.js.map +0 -1
- package/tradutores/tradutor-assembly-x64.d.ts +0 -102
- package/tradutores/tradutor-assembly-x64.d.ts.map +0 -1
- package/tradutores/tradutor-assembly-x64.js +0 -774
- package/tradutores/tradutor-assembly-x64.js.map +0 -1
- package/tradutores/tradutor-webassembly.d.ts +0 -159
- package/tradutores/tradutor-webassembly.d.ts.map +0 -1
- package/tradutores/tradutor-webassembly.js +0 -886
- package/tradutores/tradutor-webassembly.js.map +0 -1
package/README.md
CHANGED
|
@@ -136,10 +136,14 @@ Para usar dentro de uma página de internet, entre _tags_ `<script>`, veja o pro
|
|
|
136
136
|
|
|
137
137
|
Delégua possui alguns compiladores implementados. Compiladores passam código Delégua para binário, gerando executáveis, cuja execução ocorre com a máxima performance possível.
|
|
138
138
|
|
|
139
|
-
Para este núcleo, alguns compiladores são tradutores de Delégua para certos _assemblies_ (ou representações intermediárias), e que precisam de [`delegua-node`](https://github.com/DesignLiquido/delegua) ou alguma outra interface para funcionarem, como por exemplo, nossa [extensão para VSCode e derivados](https://github.com/DesignLiquido/vscode). Os detalhes da utilização podem ser vistos nos respectivos projetos.
|
|
139
|
+
Para este núcleo, alguns compiladores são tradutores de Delégua para certos _assemblies_ (ou representações intermediárias), e que precisam de [`delegua-node`](https://github.com/DesignLiquido/delegua) ou alguma outra interface para funcionarem, como por exemplo, nossa [extensão para VSCode e derivados](https://github.com/DesignLiquido/vscode). Os detalhes da utilização podem ser vistos nos respectivos projetos.
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
Os tradutores de arquitetura de processador (ou de outros alvos de execução nativa, como WebAssembly) não vivem neste núcleo: têm implementação própria, autocontida, em pacotes separados dentro de [`delegua-llvm-completo`](https://github.com/DesignLiquido/delegua-llvm-completo/tree/main/pacotes), que dependem deste núcleo apenas para léxico/sintaxe (`Lexador`, `AvaliadorSintatico`) e para os tipos da AST:
|
|
142
|
+
|
|
143
|
+
- [`delegua-x64`](https://github.com/DesignLiquido/delegua-llvm-completo/tree/main/pacotes/delegua-x64): NASM, YASM e FASM. Pode funcionar com MASM e GAS, mas requer algumas modificações pontuais na sintaxe de macros.
|
|
144
|
+
- [`delegua-arm`](https://github.com/DesignLiquido/delegua-llvm-completo/tree/main/pacotes/delegua-arm): Linux e Android.
|
|
145
|
+
- [`delegua-risc-v`](https://github.com/DesignLiquido/delegua-llvm-completo/tree/main/pacotes/delegua-risc-v): Linux, 32 e 64 bits.
|
|
146
|
+
- [`delegua-wasm`](https://github.com/DesignLiquido/delegua-llvm-completo/tree/main/pacotes/delegua-wasm): WebAssembly via WAT e `wat2wasm`.
|
|
143
147
|
|
|
144
148
|
Já outros compiladores demandam uma infraestrutura de código mais robusta e são projetos separados, que ou usam este núcleo diretamente, ou usam a sintaxe implementada no núcleo de forma independente.
|
|
145
149
|
São eles:
|
|
@@ -112,6 +112,31 @@ export declare class AvaliadorSintatico extends AvaliadorSintaticoBase implement
|
|
|
112
112
|
private obterTiposParaConsultaPrimitiva;
|
|
113
113
|
private resolverAcessoMetodoConhecido;
|
|
114
114
|
protected validarArgumentosEntidadeChamada(argumentosEntidadeChamada: InformacaoElementoSintatico[], argumentosUtilizados: ConstrutoInterface[]): string[];
|
|
115
|
+
/**
|
|
116
|
+
* `número`, `real`, `inteiro` e `longo` são todos representados internamente
|
|
117
|
+
* como números primitivos, então são intercambiáveis na validação de tipos de
|
|
118
|
+
* argumentos de chamadas de função/método.
|
|
119
|
+
* @param tipo O tipo a ser normalizado.
|
|
120
|
+
* @returns `número` quando `tipo` é um dos tipos numéricos primitivos, ou `tipo` sem alterações.
|
|
121
|
+
*/
|
|
122
|
+
private normalizarTipoNumerico;
|
|
123
|
+
/**
|
|
124
|
+
* Garante que um construto usado em um contexto explicitamente tipado como `real`
|
|
125
|
+
* (declaração de variável/constante, valor padrão de parâmetro, retorno de função ou
|
|
126
|
+
* argumento de `real()`) seja tratado como ponto flutuante na tradução, mesmo que o
|
|
127
|
+
* valor original seja um `número` inteiro-valorado:
|
|
128
|
+
* - Se for um literal numérico (ex.: `10`), apenas marca seu tipo como `real` para que
|
|
129
|
+
* os tradutores emitam `10.0` em vez de `10`.
|
|
130
|
+
* - Se for outra expressão de tipo numérico conhecido (variável, chamada, etc., ex.: `y`
|
|
131
|
+
* onde `y: número`), envolve o construto em uma chamada a `real(...)`, que os
|
|
132
|
+
* tradutores mapeiam para a conversão de ponto flutuante idiomática de cada linguagem
|
|
133
|
+
* (ex.: `float(y)` em Python, `y.to_f` em Ruby).
|
|
134
|
+
* - Se o tipo do construto já é `real`, ou é desconhecido (`qualquer`) ou não numérico,
|
|
135
|
+
* retorna o construto sem alterações — não é seguro converter estaticamente.
|
|
136
|
+
* @param construto O construto a ser garantido como `real`.
|
|
137
|
+
* @returns O construto (possivelmente envolvido em `real(...)`) a ser usado no lugar do original.
|
|
138
|
+
*/
|
|
139
|
+
private garantirTipoReal;
|
|
115
140
|
/**
|
|
116
141
|
* Diversas verificações de resolução de entidade chamada, como resolver chamada da pilha ou usar referência, argumentos, etc.
|
|
117
142
|
* @param entidadeChamada O construto da entidade chamada.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avaliador-sintatico.d.ts","sourceRoot":"","sources":["../../fontes/avaliador-sintatico/avaliador-sintatico.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,EAIH,yBAAyB,EAGzB,kBAAkB,EAKlB,OAAO,EACP,uBAAuB,EAEvB,SAAS,EAET,UAAU,EAEV,qBAAqB,EAGrB,eAAe,EACf,qBAAqB,EAErB,IAAI,EACJ,gBAAgB,EAGhB,qBAAqB,EACrB,iBAAiB,EAMjB,KAAK,EAGL,QAAQ,EAEX,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,2BAA2B,EAI3B,kBAAkB,EAClB,gBAAgB,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,sBAAsB,EACzB,MAAM,4BAA4B,CAAC;AAcpC,OAAO,EACH,KAAK,EAGL,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,EACnB,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,EAAE,EACF,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kCAA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CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,2BAA2B,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC;IAC5D,qCAAqC,EAAE,OAAO,CAAC;IAC/C,OAAO,EAAE,OAAO,CAAC;gBAEL,WAAW,UAAQ;IAsB/B,SAAS,CAAC,2BAA2B,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"avaliador-sintatico.d.ts","sourceRoot":"","sources":["../../fontes/avaliador-sintatico/avaliador-sintatico.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,EAIH,yBAAyB,EAGzB,kBAAkB,EAKlB,OAAO,EACP,uBAAuB,EAEvB,SAAS,EAET,UAAU,EAEV,qBAAqB,EAGrB,eAAe,EACf,qBAAqB,EAErB,IAAI,EACJ,gBAAgB,EAGhB,qBAAqB,EACrB,iBAAiB,EAMjB,KAAK,EAGL,QAAQ,EAEX,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,2BAA2B,EAI3B,kBAAkB,EAClB,gBAAgB,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,sBAAsB,EACzB,MAAM,4BAA4B,CAAC;AAcpC,OAAO,EACH,KAAK,EAGL,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,EACnB,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,EAAE,EACF,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kCAAkC,EAAE,MAAM,8DA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HA,kBAAkB,CAC9B,YAAY,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,EACjD,gBAAgB,EAAE,OAAO,EACzB,gBAAgB,EAAE,OAAO,EACzB,UAAU,EAAE,OAAO,EACnB,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,gBAAgB,EAAE,EAC3B,YAAY,EAAE,iBAAiB,EAAE,GAClC,OAAO,CAAC,IAAI,CAAC;IAkFD,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAwKpD;;;OAGG;IACG,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC;IAsH/C;;;;;;;;;;;OAWG;IACY,6BAA6B,IAAI,OAAO,CAAC,UAAU,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC;IAoE9F;;;;OAIG;IACH,SAAS,CAAC,WAAW,IAAI,IAAI;IA+B7B,SAAS,CAAC,oCAAoC,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;IAiB9E;;;;;;;OAOG;cACa,kBAAkB,IAAI,OAAO,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC;IA0GlE,eAAe,IAAI,OAAO,CAAC,KAAK,CAAC;IAoCvC;;;;OAIG;IACH,SAAS,CAAC,uBAAuB;IA+S3B,QAAQ,CACV,cAAc,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,EACzD,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,kCAAkC,CAAC,UAAU,CAAC,CAAC;CAsC7D"}
|
|
@@ -112,7 +112,10 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
112
112
|
return this.simbolos[this.atual].lexema;
|
|
113
113
|
}
|
|
114
114
|
const lexemaOriginal = this.simbolos[this.atual].lexema;
|
|
115
|
-
|
|
115
|
+
// `decimal` é sinônimo de `real` como nome de tipo; `real` é o nome
|
|
116
|
+
// preferido e é o único usado internamente a partir daqui.
|
|
117
|
+
const lexemaElementarBruto = lexemaOriginal.toLowerCase();
|
|
118
|
+
const lexemaElementar = lexemaElementarBruto === 'decimal' ? 'real' : lexemaElementarBruto;
|
|
116
119
|
const tipoElementarResolvido = tipos.find((tipo) => tipo === lexemaElementar);
|
|
117
120
|
if (!tipoElementarResolvido) {
|
|
118
121
|
// Mantém o avaliador sintático sincronizado mesmo com tipos não reconhecidos
|
|
@@ -529,7 +532,9 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
529
532
|
case delegua_2.default.NÚMERO:
|
|
530
533
|
case delegua_2.default.TEXTO:
|
|
531
534
|
const simboloNumeroTexto = this.avancarEDevolverAnterior();
|
|
532
|
-
const tipoInferido =
|
|
535
|
+
const tipoInferido = simboloNumeroTexto.ehNumeroReal
|
|
536
|
+
? 'real'
|
|
537
|
+
: (0, inferenciador_1.inferirTipoVariavel)(simboloNumeroTexto.literal);
|
|
533
538
|
const delimitadorTexto = simboloNumeroTexto.tipo === delegua_2.default.TEXTO
|
|
534
539
|
? simboloNumeroTexto.delimitadorTexto
|
|
535
540
|
: undefined;
|
|
@@ -916,17 +921,64 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
916
921
|
argumentoUtilizado.tipo.startsWith('função') ||
|
|
917
922
|
argumentoUtilizado instanceof construtos_1.FuncaoConstruto
|
|
918
923
|
? 'função'
|
|
919
|
-
: argumentoUtilizado.tipo;
|
|
924
|
+
: this.normalizarTipoNumerico(argumentoUtilizado.tipo);
|
|
920
925
|
const tipoArgumentoEntidadeChamada = argumentoEntidadeChamada.tipo.startsWith('funcao') ||
|
|
921
926
|
argumentoEntidadeChamada.tipo.startsWith('função')
|
|
922
927
|
? 'função'
|
|
923
|
-
: argumentoEntidadeChamada.tipo;
|
|
928
|
+
: this.normalizarTipoNumerico(argumentoEntidadeChamada.tipo);
|
|
924
929
|
if (tipoArgumentoUtilizado !== tipoArgumentoEntidadeChamada) {
|
|
925
930
|
possiveisErros.push(`Argumento: ${argumentoEntidadeChamada.nome}. Tipo esperado: ${argumentoEntidadeChamada.tipo}; Tipo utilizado: ${argumentoUtilizado.tipo}`);
|
|
926
931
|
}
|
|
927
932
|
}
|
|
928
933
|
return possiveisErros;
|
|
929
934
|
}
|
|
935
|
+
/**
|
|
936
|
+
* `número`, `real`, `inteiro` e `longo` são todos representados internamente
|
|
937
|
+
* como números primitivos, então são intercambiáveis na validação de tipos de
|
|
938
|
+
* argumentos de chamadas de função/método.
|
|
939
|
+
* @param tipo O tipo a ser normalizado.
|
|
940
|
+
* @returns `número` quando `tipo` é um dos tipos numéricos primitivos, ou `tipo` sem alterações.
|
|
941
|
+
*/
|
|
942
|
+
normalizarTipoNumerico(tipo) {
|
|
943
|
+
return ['número', 'numero', 'real', 'inteiro', 'longo'].includes(tipo) ? 'número' : tipo;
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Garante que um construto usado em um contexto explicitamente tipado como `real`
|
|
947
|
+
* (declaração de variável/constante, valor padrão de parâmetro, retorno de função ou
|
|
948
|
+
* argumento de `real()`) seja tratado como ponto flutuante na tradução, mesmo que o
|
|
949
|
+
* valor original seja um `número` inteiro-valorado:
|
|
950
|
+
* - Se for um literal numérico (ex.: `10`), apenas marca seu tipo como `real` para que
|
|
951
|
+
* os tradutores emitam `10.0` em vez de `10`.
|
|
952
|
+
* - Se for outra expressão de tipo numérico conhecido (variável, chamada, etc., ex.: `y`
|
|
953
|
+
* onde `y: número`), envolve o construto em uma chamada a `real(...)`, que os
|
|
954
|
+
* tradutores mapeiam para a conversão de ponto flutuante idiomática de cada linguagem
|
|
955
|
+
* (ex.: `float(y)` em Python, `y.to_f` em Ruby).
|
|
956
|
+
* - Se o tipo do construto já é `real`, ou é desconhecido (`qualquer`) ou não numérico,
|
|
957
|
+
* retorna o construto sem alterações — não é seguro converter estaticamente.
|
|
958
|
+
* @param construto O construto a ser garantido como `real`.
|
|
959
|
+
* @returns O construto (possivelmente envolvido em `real(...)`) a ser usado no lugar do original.
|
|
960
|
+
*/
|
|
961
|
+
garantirTipoReal(construto) {
|
|
962
|
+
if (!construto) {
|
|
963
|
+
return construto;
|
|
964
|
+
}
|
|
965
|
+
if (construto.constructor === construtos_1.Literal && typeof construto.valor === 'number') {
|
|
966
|
+
construto.tipo = 'real';
|
|
967
|
+
return construto;
|
|
968
|
+
}
|
|
969
|
+
if (construto.tipo === 'real') {
|
|
970
|
+
return construto;
|
|
971
|
+
}
|
|
972
|
+
const ehTipoNumericoConhecido = typeof construto.tipo === 'string' &&
|
|
973
|
+
['número', 'numero', 'inteiro', 'longo'].includes(construto.tipo);
|
|
974
|
+
if (!ehTipoNumericoConhecido) {
|
|
975
|
+
return construto;
|
|
976
|
+
}
|
|
977
|
+
const simboloReal = new simbolo_1.Simbolo(delegua_2.default.IDENTIFICADOR, 'real', null, construto.linha, construto.hashArquivo);
|
|
978
|
+
const chamadaReal = new construtos_1.Chamada(construto.hashArquivo, new construtos_1.Variavel(construto.hashArquivo, simboloReal, 'função'), [construto]);
|
|
979
|
+
chamadaReal.tipo = 'real';
|
|
980
|
+
return chamadaReal;
|
|
981
|
+
}
|
|
930
982
|
/**
|
|
931
983
|
* Diversas verificações de resolução de entidade chamada, como resolver chamada da pilha ou usar referência, argumentos, etc.
|
|
932
984
|
* @param entidadeChamada O construto da entidade chamada.
|
|
@@ -940,6 +992,18 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
940
992
|
}
|
|
941
993
|
if (entidadeChamada.constructor === construtos_1.Variavel) {
|
|
942
994
|
const entidadeChamadaResolvidaVariavel = entidadeChamada;
|
|
995
|
+
// `real(valor)` converte explicitamente para ponto flutuante, então um
|
|
996
|
+
// literal numérico passado diretamente deve preservar a natureza real
|
|
997
|
+
// na tradução (ex.: `real(10)` -> `real(10.0)`). Note que aqui só marcamos
|
|
998
|
+
// literais diretamente, sem usar garantirTipoReal(): o argumento já está
|
|
999
|
+
// dentro de uma chamada a `real(...)`, então não deve ser envolvido de novo.
|
|
1000
|
+
if (entidadeChamadaResolvidaVariavel.simbolo.lexema === 'real' && argumentos.length > 0) {
|
|
1001
|
+
const primeiroArgumento = argumentos[0];
|
|
1002
|
+
if (primeiroArgumento.constructor === construtos_1.Literal &&
|
|
1003
|
+
typeof primeiroArgumento.valor === 'number') {
|
|
1004
|
+
primeiroArgumento.tipo = 'real';
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
943
1007
|
const informacoesFuncaoBibliotecaGlobal = this.pilhaEscopos.obterBibliotecaGlobal(entidadeChamadaResolvidaVariavel.simbolo.lexema);
|
|
944
1008
|
if (informacoesFuncaoBibliotecaGlobal &&
|
|
945
1009
|
Array.isArray(informacoesFuncaoBibliotecaGlobal.subElementos) &&
|
|
@@ -2075,8 +2139,11 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
2075
2139
|
throw this.erro(simboloVariavel, 'Quantidade de identificadores à esquerda do igual é diferente da quantidade de valores à direita.');
|
|
2076
2140
|
}
|
|
2077
2141
|
for (let [indice, identificador] of identificadores.entries()) {
|
|
2142
|
+
const tipoInferido = this.logicaComumInferenciaTiposVariaveisEConstantes(inicializadores[indice], tipo) ?? tipo;
|
|
2143
|
+
if (tipoExplicito && tipo === 'real') {
|
|
2144
|
+
inicializadores[indice] = this.garantirTipoReal(inicializadores[indice]);
|
|
2145
|
+
}
|
|
2078
2146
|
const inicializador = inicializadores[indice];
|
|
2079
|
-
const tipoInferido = this.logicaComumInferenciaTiposVariaveisEConstantes(inicializador, tipo) ?? tipo;
|
|
2080
2147
|
const informacaoSintatica = tipo === 'dicionário'
|
|
2081
2148
|
? this.resolverInformacaoElementoSintaticoDeDicionario(inicializador)
|
|
2082
2149
|
: new informacao_elemento_sintatico_1.InformacaoElementoSintatico(identificador.lexema, tipoInferido);
|
|
@@ -2142,6 +2209,9 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
2142
2209
|
// Se tipo ainda não foi definido, infere.
|
|
2143
2210
|
tipo =
|
|
2144
2211
|
this.logicaComumInferenciaTiposVariaveisEConstantes(inicializadores[indice], tipo) ?? tipo;
|
|
2212
|
+
if (tipoExplicito && tipo === 'real') {
|
|
2213
|
+
inicializadores[indice] = this.garantirTipoReal(inicializadores[indice]);
|
|
2214
|
+
}
|
|
2145
2215
|
if (tipo !== 'dicionário') {
|
|
2146
2216
|
this.pilhaEscopos.definirInformacoesVariavel(identificador.lexema, new informacao_elemento_sintatico_1.InformacaoElementoSintatico(identificador.lexema, tipo));
|
|
2147
2217
|
}
|
|
@@ -2206,6 +2276,9 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
2206
2276
|
const valorPadrao = await this.primario();
|
|
2207
2277
|
parametro.valorPadrao = valorPadrao;
|
|
2208
2278
|
}
|
|
2279
|
+
if (parametro.tipoDado === 'real') {
|
|
2280
|
+
parametro.valorPadrao = this.garantirTipoReal(parametro.valorPadrao);
|
|
2281
|
+
}
|
|
2209
2282
|
this.pilhaEscopos.definirInformacoesVariavel(parametro.nome.lexema, new informacao_elemento_sintatico_1.InformacaoElementoSintatico(parametro.nome.lexema, parametro.tipoDado || 'qualquer'));
|
|
2210
2283
|
parametros.push(parametro);
|
|
2211
2284
|
if (parametro.abrangencia === 'multiplo')
|
|
@@ -2235,6 +2308,11 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
2235
2308
|
for (const declaracao of corpo) {
|
|
2236
2309
|
expressoesRetorna = expressoesRetorna.concat((0, comum_1.buscarRetornos)(declaracao));
|
|
2237
2310
|
}
|
|
2311
|
+
if (tipoRetorno === 'real') {
|
|
2312
|
+
for (const retorno of expressoesRetorna) {
|
|
2313
|
+
retorno.valor = this.garantirTipoReal(retorno.valor);
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2238
2316
|
if (tipoRetorno === 'vazio' && expressoesRetorna.length > 0) {
|
|
2239
2317
|
// Filtra retornos que têm tipo conhecido e diferente de 'vazio'.
|
|
2240
2318
|
// 'qualquer' é excluído pois o tipo não pode ser determinado em tempo de análise sintática.
|
|
@@ -2422,6 +2500,11 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
2422
2500
|
tipoRetorno = 'vazio';
|
|
2423
2501
|
}
|
|
2424
2502
|
}
|
|
2503
|
+
if (tipoRetorno === 'real') {
|
|
2504
|
+
for (const retorno of expressoesRetorna) {
|
|
2505
|
+
retorno.valor = this.garantirTipoReal(retorno.valor);
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2425
2508
|
const corpoFuncao = new construtos_1.FuncaoConstruto(this.hashArquivo, nomeMetodo.linha, params, corpo, tipoRetorno);
|
|
2426
2509
|
const tipoDaFuncao = `função<${tipoRetorno}>`;
|
|
2427
2510
|
const metodo = new declaracoes_1.FuncaoDeclaracao(nomeMetodo, corpoFuncao, tipoDaFuncao);
|
|
@@ -2439,7 +2522,8 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
2439
2522
|
const nomePropriedade = this.consumir(delegua_2.default.IDENTIFICADOR, 'Esperado identificador para nome de propriedade.');
|
|
2440
2523
|
this.consumir(delegua_2.default.DOIS_PONTOS, 'Esperado dois-pontos após nome de propriedade.');
|
|
2441
2524
|
const tipoPropriedade = this.avancarEDevolverAnterior();
|
|
2442
|
-
|
|
2525
|
+
// `decimal` é sinônimo de `real` como nome de tipo; `real` é o nome preferido.
|
|
2526
|
+
let nomeTipoPropriedade = tipoPropriedade.lexema.toLowerCase() === 'decimal' ? 'real' : tipoPropriedade.lexema;
|
|
2443
2527
|
if (this.verificarTipoSimboloAtual(delegua_2.default.COLCHETE_ESQUERDO)) {
|
|
2444
2528
|
this.avancarEDevolverAnterior();
|
|
2445
2529
|
this.consumir(delegua_2.default.COLCHETE_DIREITO, "Esperado ']' após '[' na definição do tipo de propriedade.");
|
|
@@ -2773,6 +2857,11 @@ class AvaliadorSintatico extends avaliador_sintatico_base_1.AvaliadorSintaticoBa
|
|
|
2773
2857
|
tipoRetorno = 'vazio';
|
|
2774
2858
|
}
|
|
2775
2859
|
}
|
|
2860
|
+
if (tipoRetorno === 'real') {
|
|
2861
|
+
for (const retorno of expressoesRetorna) {
|
|
2862
|
+
retorno.valor = this.garantirTipoReal(retorno.valor);
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2776
2865
|
const corpoFuncao = new construtos_1.FuncaoConstruto(this.hashArquivo, nomeMetodo.linha, params, corpo, tipoRetorno);
|
|
2777
2866
|
const tipoDaFuncao = `função<${tipoRetorno}>`;
|
|
2778
2867
|
const metodo = new declaracoes_1.FuncaoDeclaracao(nomeMetodo, corpoFuncao, tipoDaFuncao);
|