object, not table: fix user-facing terminology
The language is OOP with a single compound value, the object (an
anonymous `{...}` or a class instance); it is not Lua and has no
"tables". The visible type name was already `object`; this fixes the
remaining user-facing wording:
- error messages: "object has no member 'x'", "object is not callable".
- README: drop the "Lua-like" phrasing; describe member objects, not
tables.
- self-hosted front-end AST node `t="object"` (was "table"), updated
across parser/compiler/checker.
- test comments/expected output aligned ("object:").
The internal C symbols keep the cat_types_table_* naming convention.
Suite stays 130 green.
This commit is contained in:
1 parent
a73600e221
commit
7cdf388bf4
10 files changed
+18
-18
No files matched your search
@@ -1,7 +1,7 @@
|
||||
# catscript
|
||||
|
||||
Uma linguagem de scripting pequena, escrita em C, **100% orientada a
|
||||
objetos**, com sintaxe parecida com Lua e **tipagem estrutural**.
|
||||
objetos**, com sintaxe enxuta e **tipagem estrutural**.
|
||||
|
||||
Este repositório contém:
|
||||
|
||||
@@ -64,7 +64,7 @@ parser, o checker e o compiler são programas catscript**:
|
||||
- `src/catscript/compiler.cat` — gera bytecode a partir da AST.
|
||||
|
||||
O runtime C expõe primitivas (`bc_run`, `bc_dump`) que transformam uma
|
||||
"chunk" (uma tabela catscript: `{name, nparams, nlocals, consts, protos,
|
||||
"chunk" (um objeto catscript: `{name, nparams, nlocals, consts, protos,
|
||||
code}`) em bytecode executável. Assim, código catscript compila e executa
|
||||
código catscript.
|
||||
|
||||
@@ -339,8 +339,8 @@ Vulkan roda **headless** (lavapipe/llvmpipe); GLFW precisa de um display
|
||||
|
||||
## Funções também são objetos
|
||||
|
||||
Uma closure tem sua própria tabela de membros, então carrega `_doc_` (e
|
||||
qualquer outro atributo) como uma tabela:
|
||||
Uma closure tem seu próprio objeto de membros, então carrega `_doc_` (e
|
||||
qualquer outro atributo) como um objeto:
|
||||
|
||||
```lua
|
||||
function add(a, b) return a + b end
|
||||
|
||||
Reference in new issue
Block a user