lucidaflow 1.0.0__tar.gz → 1.0.2__tar.gz

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.

Potentially problematic release.


This version of lucidaflow might be problematic. Click here for more details.

Files changed (25) hide show
  1. {lucidaflow-1.0.0/src/lucidaflow.egg-info → lucidaflow-1.0.2}/PKG-INFO +1 -1
  2. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/pyproject.toml +14 -4
  3. lucidaflow-1.0.2/src/lucidaflow/cli.py +50 -0
  4. lucidaflow-1.0.2/src/lucidaflow/lib/__init__.py +0 -0
  5. lucidaflow-1.0.2/src/lucidaflow/lib/dado.py +35 -0
  6. lucidaflow-1.0.2/src/lucidaflow/lib/json.py +46 -0
  7. lucidaflow-1.0.2/src/lucidaflow/lib/web.py +36 -0
  8. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_analyzer.py +6 -6
  9. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_interpreter.py +8 -8
  10. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_parser.py +2 -2
  11. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_stdlib.py +4 -4
  12. {lucidaflow-1.0.0 → lucidaflow-1.0.2/src/lucidaflow.egg-info}/PKG-INFO +1 -1
  13. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow.egg-info/SOURCES.txt +7 -1
  14. lucidaflow-1.0.2/src/lucidaflow.egg-info/entry_points.txt +2 -0
  15. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/LICENSE +0 -0
  16. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/README.md +0 -0
  17. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/setup.cfg +0 -0
  18. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/__init__.py +0 -0
  19. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_ast.py +0 -0
  20. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_errors.py +0 -0
  21. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_lexer.py +0 -0
  22. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow/lucida_symbols.py +0 -0
  23. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow.egg-info/dependency_links.txt +0 -0
  24. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow.egg-info/requires.txt +0 -0
  25. {lucidaflow-1.0.0 → lucidaflow-1.0.2}/src/lucidaflow.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lucidaflow
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Uma linguagem de script moderna, extensível e com tipagem gradual, implementada em Python.
5
5
  Author-email: Marco Lago <marconeed2@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/marconeed/Lucida-Flow
@@ -1,10 +1,12 @@
1
+ # pyproject.toml (Versão Corrigida e Final)
2
+
1
3
  [build-system]
2
4
  requires = ["setuptools>=61.0"]
3
5
  build-backend = "setuptools.build_meta"
4
6
 
5
7
  [project]
6
8
  name = "lucidaflow"
7
- version = "1.0.0"
9
+ version = "1.0.2" # Aumentei a versão para a nova publicação
8
10
  authors = [
9
11
  { name="Marco Lago", email="marconeed2@gmail.com" },
10
12
  ]
@@ -22,10 +24,18 @@ dependencies = [
22
24
  "numpy",
23
25
  "pysine",
24
26
  "requests",
25
- # Nota: pygame e nextcord não são dependências do *motor*,
26
- # mas sim dos *projetos* que usam o motor.
27
27
  ]
28
28
 
29
29
  [project.urls]
30
30
  Homepage = "https://github.com/marconeed/Lucida-Flow"
31
- Issues = "https://github.com/marconeed/Lucida-Flow/issues"
31
+ Issues = "https://github.com/marconeed/Lucida-Flow/issues"
32
+
33
+ [project.scripts]
34
+ lucidaflow = "lucidaflow.cli:main"
35
+
36
+ # --- ADICIONE ESTA SECÇÃO NO FINAL DO FICHEIRO ---
37
+ [tool.setuptools.packages.find]
38
+ where = ["src"]
39
+
40
+ [tool.setuptools.package-data]
41
+ lucidaflow = ["lib/*.py"]
@@ -0,0 +1,50 @@
1
+ # src/lucidaflow/cli.py
2
+
3
+ import sys
4
+ from lucidaflow.lucida_lexer import Lexer
5
+ from lucidaflow.lucida_parser import Parser
6
+ from lucidaflow.lucida_analyzer import SemanticAnalyzer
7
+ from lucidaflow.lucida_interpreter import Interpreter
8
+ from lucidaflow.lucida_errors import LucidaError
9
+ from lucidaflow.lucida_ast import ProgramNode
10
+
11
+ def run_code(source_code, analyzer, interpreter):
12
+ lexer = Lexer(source_code)
13
+ parser = Parser(lexer)
14
+ ast = parser.parse()
15
+ analyzer.visit(ast)
16
+ result = interpreter.visit(ast)
17
+ return result
18
+
19
+ def start_repl():
20
+ print("Lucida-Flow REPL v1.0 (Instalado via pip)")
21
+ print("Digite 'exit' ou 'sair' para terminar.")
22
+
23
+ analyzer = SemanticAnalyzer()
24
+ interpreter = Interpreter()
25
+ analyzer.visit(ProgramNode([]))
26
+
27
+ while True:
28
+ try:
29
+ line = input("lf> ")
30
+ if line.strip().lower() in ('exit', 'sair'):
31
+ break
32
+
33
+ if not line.strip():
34
+ continue
35
+
36
+ result = run_code(line, analyzer, interpreter)
37
+
38
+ if result is not None:
39
+ print(result)
40
+ except LucidaError as e:
41
+ print(e)
42
+ except Exception as e:
43
+ print(f"Erro de sistema: {e}")
44
+
45
+ def main():
46
+ # Por agora, a nossa ferramenta de linha de comando só inicia o REPL.
47
+ start_repl()
48
+
49
+ if __name__ == '__main__':
50
+ main()
File without changes
@@ -0,0 +1,35 @@
1
+ # lib/dado.py
2
+ import random
3
+ from lucidaflow..lucida_symbols import VarSymbol, BuiltInFunctionSymbol, ScopedSymbolTable, BuiltInTypeSymbol
4
+
5
+ # --- Lógica de Runtime ---
6
+ def lf_d6(args):
7
+ return random.randint(1, 6)
8
+
9
+ def lf_rolar_entre(args):
10
+ if len(args) != 2: raise TypeError("rolar_entre() espera 2 argumentos (min, max)")
11
+ min_val, max_val = int(args[0]), int(args[1])
12
+ return random.randint(min_val, max_val)
13
+
14
+ NATIVE_DADO_MODULE = {
15
+ 'd6': lf_d6,
16
+ 'rolar_entre': lf_rolar_entre,
17
+ }
18
+
19
+ # --- Descrição Semântica ---
20
+ def register_semantics():
21
+ int_type = BuiltInTypeSymbol('int')
22
+ module_scope = ScopedSymbolTable(scope_name='dado', scope_level=2)
23
+ module_scope.define(BuiltInFunctionSymbol(name='d6', params=[], return_type=int_type))
24
+
25
+ # --- A DEFINIÇÃO QUE PROVAVELMENTE FALTA ---
26
+ module_scope.define(
27
+ BuiltInFunctionSymbol(
28
+ name='rolar_entre',
29
+ params=[VarSymbol('min', int_type), VarSymbol('max', int_type)],
30
+ return_type=int_type
31
+ )
32
+ )
33
+ # -----------------------------------------
34
+
35
+ return module_scope
@@ -0,0 +1,46 @@
1
+ # lib/json.py
2
+ import json
3
+ from lucidaflow..lucida_symbols import VarSymbol, BuiltInFunctionSymbol, ScopedSymbolTable, BuiltInTypeSymbol
4
+
5
+ # --- PARTE 1: Lógica de Runtime ---
6
+
7
+ def lf_json_parse(args):
8
+ if len(args) != 1: raise TypeError("parse() espera 1 argumento (a string JSON)")
9
+ try:
10
+ return json.loads(args[0])
11
+ except json.JSONDecodeError as e:
12
+ raise ValueError(f"String JSON inválida: {e}")
13
+
14
+ def lf_json_stringify(args):
15
+ obj_to_stringify = args[0]
16
+ indent = int(args[1]) if len(args) > 1 else None
17
+ return json.dumps(obj_to_stringify, indent=indent, ensure_ascii=False)
18
+
19
+ NATIVE_JSON_MODULE = {
20
+ "parse": lf_json_parse,
21
+ "stringify": lf_json_stringify,
22
+ }
23
+
24
+ # --- PARTE 2: Descrição Semântica ---
25
+
26
+ def register_semantics():
27
+ string_type = BuiltInTypeSymbol('string')
28
+ int_type = BuiltInTypeSymbol('int')
29
+ any_type = BuiltInTypeSymbol('any')
30
+
31
+ module_scope = ScopedSymbolTable(scope_name='json', scope_level=2)
32
+ module_scope.define(
33
+ BuiltInFunctionSymbol(
34
+ name='parse',
35
+ params=[VarSymbol('json_string', string_type)],
36
+ return_type=any_type
37
+ )
38
+ )
39
+ module_scope.define(
40
+ BuiltInFunctionSymbol(
41
+ name='stringify',
42
+ params=[VarSymbol('objeto', any_type), VarSymbol('indent', int_type, is_optional=True)],
43
+ return_type=string_type
44
+ )
45
+ )
46
+ return module_scope
@@ -0,0 +1,36 @@
1
+ # lib/web.py
2
+ import requests
3
+ from lucidaflow..lucida_symbols import VarSymbol, BuiltInFunctionSymbol, ScopedSymbolTable, BuiltInTypeSymbol
4
+
5
+ # --- PARTE 1: Lógica de Runtime ---
6
+
7
+ def lf_web_get(args):
8
+ if len(args) != 1:
9
+ raise TypeError("A função get() espera 1 argumento (a URL)")
10
+ url = str(args[0])
11
+ try:
12
+ response = requests.get(url)
13
+ response.raise_for_status() # Lança um erro para status HTTP ruins (4xx ou 5xx)
14
+ return response.text
15
+ except requests.exceptions.RequestException as e:
16
+ raise Exception(f"Erro de rede ao aceder a '{url}': {e}")
17
+
18
+ NATIVE_WEB_MODULE = {
19
+ "get": lf_web_get,
20
+ }
21
+
22
+ # --- PARTE 2: Descrição Semântica ---
23
+
24
+ def register_semantics():
25
+ string_type = BuiltInTypeSymbol('string')
26
+ any_type = BuiltInTypeSymbol('any')
27
+
28
+ module_scope = ScopedSymbolTable(scope_name='web', scope_level=2)
29
+ module_scope.define(
30
+ BuiltInFunctionSymbol(
31
+ name='get',
32
+ params=[VarSymbol('url', string_type)],
33
+ return_type=string_type
34
+ )
35
+ )
36
+ return module_scope
@@ -1,20 +1,20 @@
1
1
  # Copie e cole TODO este conteúdo em seu arquivo lucida_analyzer.py
2
2
 
3
- from lucida_ast import *
4
- from lucida_errors import LucidaSemanticError
5
- from lucida_stdlib import NATIVE_MODULES_SEMANTICS
6
- from lucida_symbols import (
3
+ from lucidaflow.lucida_ast import *
4
+ from lucidaflow.lucida_errors import LucidaSemanticError
5
+ from lucidaflow.lucida_stdlib import NATIVE_MODULES_SEMANTICS
6
+ from lucidaflow.lucida_symbols import (
7
7
  Symbol, VarSymbol, BuiltInTypeSymbol, BuiltInFunctionSymbol,
8
8
  ProcessSymbol, TypeSymbol, ModuleSymbol, ScopedSymbolTable,
9
9
  ListTypeSymbol, DictTypeSymbol, EnumSymbol, EnumMemberSymbol,
10
10
  FunctionTypeSymbol, TupleTypeSymbol # <--- ADICIONE AQUI
11
11
  )
12
- from lucida_lexer import (
12
+ from lucidaflow.lucida_lexer import (
13
13
  Lexer, T_PLUS, T_MINUS, T_MUL, T_DIV, T_POW, T_MOD, T_EQ, T_NE, T_LT,
14
14
  T_GT, T_LTE, T_GTE, T_AMPERSAND, T_PIPE, T_CARET, T_LSHIFT, T_RSHIFT,
15
15
  T_IDENTIFIER, Token # <-- ADICIONE 'Token' AQUI
16
16
  )
17
- from lucida_parser import Parser
17
+ from lucidaflow.lucida_parser import Parser
18
18
  import importlib.util
19
19
  import sys
20
20
  from pathlib import Path
@@ -1,17 +1,17 @@
1
1
  # Copie e cole TODO este conteúdo em seu arquivo do Interpretador
2
2
 
3
3
  import numpy as np
4
- from lucida_ast import *
5
- from lucida_lexer import *
6
- from lucida_symbols import *
7
- from lucida_parser import Parser
8
- from lucida_errors import LucidaRuntimeError
9
- from lucida_stdlib import NATIVE_MODULES
10
- from lucida_stdlib import NATIVE_MODULES_SEMANTICS
4
+ from lucidaflow.lucida_ast import *
5
+ from lucidaflow.lucida_lexer import *
6
+ from lucidaflow.lucida_symbols import *
7
+ from lucidaflow.lucida_parser import Parser
8
+ from lucidaflow.lucida_errors import LucidaRuntimeError
9
+ from lucidaflow.lucida_stdlib import NATIVE_MODULES
10
+ from lucidaflow.lucida_stdlib import NATIVE_MODULES_SEMANTICS
11
11
  import importlib.util # Para carregar código Python dinamicamente
12
12
  import sys # Para ajustar o caminho de busca
13
13
  from pathlib import Path # Para manipular caminhos de arquivo
14
- from lucida_stdlib import NATIVE_TYPE_METHODS
14
+ from lucidaflow.lucida_stdlib import NATIVE_TYPE_METHODS
15
15
  # Removido o import do SemanticAnalyzer, pois não é usado aqui
16
16
  # from lucida_analyzer import SemanticAnalyzer
17
17
 
@@ -1,7 +1,7 @@
1
1
  # --- CÓDIGO COMPLETO E DEFINITIVO PARA lucida_parser.py ---
2
2
 
3
- from lucida_lexer import *
4
- from lucida_ast import *
3
+ from lucidaflow.lucida_lexer import *
4
+ from lucidaflow.lucida_ast import *
5
5
 
6
6
  class Parser:
7
7
  def __init__(self, lexer):
@@ -6,13 +6,13 @@ import time
6
6
  import os
7
7
  import datetime
8
8
 
9
- from lib.web import NATIVE_WEB_MODULE, register_semantics as register_web_semantics
10
- from lib.json import NATIVE_JSON_MODULE, register_semantics as register_json_semantics
11
- from lib.dado import NATIVE_DADO_MODULE, register_semantics as register_dado_semantics
9
+ from lucidaflow.lib.web import NATIVE_WEB_MODULE, register_semantics as register_web_semantics
10
+ from lucidaflow.lib.json import NATIVE_JSON_MODULE, register_semantics as register_json_semantics
11
+ from lucidaflow.lib.dado import NATIVE_DADO_MODULE, register_semantics as register_dado_semantics
12
12
 
13
13
  # --- Importações dos Símbolos da Lucida-Flow ---
14
14
  # (Necessário para a parte de descrição semântica)
15
- from lucida_symbols import (
15
+ from lucidaflow.lucida_symbols import (
16
16
  VarSymbol, BuiltInFunctionSymbol, ScopedSymbolTable, BuiltInTypeSymbol,
17
17
  ListTypeSymbol, DictTypeSymbol, TupleTypeSymbol
18
18
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lucidaflow
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Uma linguagem de script moderna, extensível e com tipagem gradual, implementada em Python.
5
5
  Author-email: Marco Lago <marconeed2@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/marconeed/Lucida-Flow
@@ -2,6 +2,7 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  src/lucidaflow/__init__.py
5
+ src/lucidaflow/cli.py
5
6
  src/lucidaflow/lucida_analyzer.py
6
7
  src/lucidaflow/lucida_ast.py
7
8
  src/lucidaflow/lucida_errors.py
@@ -13,5 +14,10 @@ src/lucidaflow/lucida_symbols.py
13
14
  src/lucidaflow.egg-info/PKG-INFO
14
15
  src/lucidaflow.egg-info/SOURCES.txt
15
16
  src/lucidaflow.egg-info/dependency_links.txt
17
+ src/lucidaflow.egg-info/entry_points.txt
16
18
  src/lucidaflow.egg-info/requires.txt
17
- src/lucidaflow.egg-info/top_level.txt
19
+ src/lucidaflow.egg-info/top_level.txt
20
+ src/lucidaflow/lib/__init__.py
21
+ src/lucidaflow/lib/dado.py
22
+ src/lucidaflow/lib/json.py
23
+ src/lucidaflow/lib/web.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ lucidaflow = lucidaflow.cli:main
File without changes
File without changes
File without changes