ErrorsProject layout and modules · rule
syntax.expected_name
Expected a name.
Area 1, Project layout and modules; not declinable; the next step is usually the agent's.
type Pair = Object { : Int}
error This member has no name
--> main.jadpo:2:5
|2 | : Int | ^ expected a name before `:`
- reason
- Every member inside braces is
name: value. - next
- Add the member's name before
:(agent) - rule
- syntax.
expected_ name - help
- https://jadpo.
dev/docs/errors/syntax. expected_ name
A domain is named by its folder, so a folder named with a reserved word is
refused there, once. Where the domain is used, library.borrow(...), the
word is read as its name and nothing more is reported:
use libraryaction lend_book() -> Unit { library.borrow()}
public action borrow() -> Unit {} error library is a reserved word and can't name a domain
--> domains/library/actions/borrow.jadpo
- reason
- A domain's folder name is its name, written before each call into it, and a reserved word can't be a name:
library.would read as the word, not the domain. - next
- Rename the folder
domains/library/after the business area it covers, and write the new name whereverlibrary.names the domain (agent) - rule
- syntax.
expected_ name - help
- https://jadpo.
dev/docs/errors/syntax. expected_ name
(agent) means your coding agent can rename it: this project has no commit
yet, so no one depends on the name. Once the project has a commit, the next
step ends (human), and a person decides.
A block whose names are wrong reports the first: a later line is most often the same mistake again, and is reported once the first is fixed.
A field may be named with a reserved word, but only what holds it can read
it, booking.type. On its own the word is never a name, and a rule across
fields names its fields alone, so it can't read this one:
type Kind = Enum { a b}type Booking = Object { type: Kind other: Kind rule same: type == other}
error type is a reserved word
--> main.jadpo:9:16
|9 | rule same: type == other | ^^^^ can't be read on its own
- reason
- A field may be named with a reserved word, and is then read through what holds it,
thing.type. On its own the word is never a name, so a rule's condition, which names fields alone, can't read one. - next
- Read it as
thing.type; in a rule's condition, rename the field (agent) - rule
- syntax.
expected_ name - help
- https://jadpo.
dev/docs/errors/syntax. expected_ name
Markdown for agents: /docs/errors/syntax.expected_name.md.Built from Jadpo main at aee2e8f.