ecma-parse-cat 0.2.0

ECMAScript parser consuming ecma-lex-cat tokens and producing ecma-syntax-cat Program ASTs. Comprehensive ES2024 surface (classes, modules, destructuring, async/await, optional chaining, templates). Recursive-descent with precedence climbing. v0.2.0 emits `ObjectPropertyKind::Get` / `Set` / `Method` for accessor and shorthand-method object-literal syntax (`{ get x() {} }`, `{ set x(v) {} }`, `{ foo() {} }`), with `get`/`set` disambiguated by lookahead (followed by another property key -> accessor; followed by `(` -> shorthand method named `get`/`set`; followed by `,` / `}` / `:` -> data property).
# CLAUDE.md -- Rust Project Conventions

## Philosophy

Functional, type-driven, domain-driven.

## Architecture

- Modules by domain context.
- Each parsing concern (expression, statement, pattern, declaration, class, module) gets its own module.
- Thin lib.rs that wires contexts together.

## Types

- Newtypes for domain primitives.
- Sum types for variants.
- No public struct fields; enum variants with named fields are permitted.
- `#[must_use]` on getters and constructors.

## Error Handling

- Single project-wide `Error` enum.
- Display + std::error::Error impls by hand; no thiserror, no anyhow.
- Never panic in library code.

## Style

- Prefer match over if/else, except on bool.
- No `return` keyword.
- No `mut`.
- Combinators over loops.
- Never match on Option<_>; use combinators.
- Prefer combinators on Result<_, _>; match only when arms are complex.
- No unwrap()/expect() anywhere.
- No loop or for.
- No scan.
- No Rc/Arc.
- No naked `as` casts.
- Exhaustive matches; no `_` wildcard arm on enums.
- Iterators over indexed access.

## Traits

- No dyn Trait.
- Implement standard traits over ad-hoc methods.

## Linting

```toml
[lints.clippy]
all = { level = "deny", priority = -1 }
pedantic = { level = "warn", priority = -1 }
needless_pass_by_value = "warn"
manual_map = "warn"
```

## Verification

- Always run `RUSTFLAGS="-D warnings" cargo clippy --all-targets`.
- Always run `cargo fmt`.

## Testing

- Tests return `Result<(), Error>` and propagate failures with `?`.
- No assert!, assert_eq!, panic!, unreachable!, unwrap, expect.
- Integration tests in tests/ organized by concern.

## Dependencies

- `ecma-syntax-cat = "0.1"` for AST types.
- `ecma-lex-cat = "0.1"` for tokens.
- `proptest` dev-dep.
- No path dependencies.

## Documentation

- `///` doc comments on every public item.
- `# Examples` with runnable code blocks.
- Doctests must not use unwrap/expect/unreachable.

## Layer context

This crate is the **parser** in the boa-cat stack:

1. `ecma-syntax-cat` -- AST types.
2. `ecma-lex-cat` -- tokenizer.
3. **`ecma-parse-cat`** -- parser; consumes Vec&lt;Token&gt;, produces Program.
4. `boa-cat` -- engine.
5. `ecma-runtime-cat` -- built-ins.
6. `tauri-runtime-servocat` -- Tauri bridge.

## Parsing strategy

- Recursive descent for statements and declarations.
- Precedence climbing for expressions.
- Cover-grammar refinement: parenthesised expressions get reinterpreted as arrow parameters when `=>` follows.
- ASI: a `;` is optional immediately before `}` or EOF; required elsewhere.  Full newline-based ASI is a v0.3 TODO (the lexer would need to expose line-terminator hints).

## v0.2 additions

- `parse_object_member` emits `ObjectPropertyKind::Get` / `Set` / `Method` in addition to `Init`:
  - `{ get x() {} }` / `{ set x(v) {} }` -- a leading identifier `get` or `set` followed by another property-key start (`identifier` / `"string"` / `42` / `[computed]`) opens an accessor; the parser consumes the `get`/`set`, parses the actual key, then parses `(params) { body }` as an anonymous `FunctionExpression` (the engine wraps it as the getter/setter half).
  - `{ foo() {} }` -- after a normal key, an immediately-following `(` opens a shorthand method; same `parse_method_function` helper builds the anonymous `FunctionExpression`.
  - Disambiguation for the literal identifier strings `get` / `set`: they fall back to data-property semantics when the next token is `(` (shorthand method named `get` / `set`), `:` (data property), or `,` / `}` (shorthand init referencing a variable).
- Method / accessor functions are NOT prefixed with the `function` keyword; the new `parse_method_function` helper consumes only `(params) { body }`.
- Getter / setter arity (0 / 1) is NOT yet validated at parse time; the engine can reject mismatches at invocation if needed.  Adding parse-time arity checks is deferred.