Commit graph

7 commits

Author SHA1 Message Date
f532d13d8c v2: Implement Interpreter.atg with typed FunctionValue, mixed-arg functions, and expression-binding (:=); fix Coco/R csproj command
This completes the v2 grammar based on master’s capabilities while aligning with the v2 design philosophy (numeric-first, strings as function-args only):

- Implement full arithmetic grammar ( +, -, *, /, %, ^, parentheses, unary sign ), with support for number/hex/binary literals.
- Add variables and arrays:
  - Numeric variables via :: (evaluate RHS now and store numeric)
  - Expression-bound variables via := (capture RHS text; re-parse and evaluate at use-time)
  - Numeric arrays via -> and array literals + indexing (with bounds/type checks)
- Add comparisons (==, <, >, <=, >=) producing FunctionValue TRUE/FALSE.
- Add function calls with mixed arguments: numeric expressions and quoted string literals.
  - In numeric contexts, enforce numeric results; emit clear type errors if a function returns a string.
- Root production always produces a FunctionValue through InputInterpreter.ProduceOutput(FunctionValue).

Runtime integration (expected APIs on InputInterpreter):
- Variable APIs: AssignNumeric, AssignExpression, AssignNumericArray; TryGetNumeric, TryGetExpression, TryGetNumericArray
- Function dispatch: ExecuteFunction(name, FunctionArgument[])
- Expression evaluation for :=: EvaluateExpression(expressionText)

Coco/R build fix:
- Correct the PreBuild command in src/core/core.csproj:
  - Use -frames (without the stray space) and point to cocor
  - Use the correct case and path for the grammar: cocor/Interpreter.atg

Notes:
- Strings are valid only as function arguments and not as standalone values or variables.
- Grammar emits concise, actionable error messages for type mismatches, missing variables, and array bounds.
2025-08-19 03:45:57 -05:00
66ec23a420 Update README.md 2025-08-19 03:09:41 -05:00
841a10cb97 Update README.md 2025-08-19 03:06:57 -05:00
87bec68e1f docs: add Design Philosophy and Args-Only Strings guidance for v2 2025-08-19 03:06:13 -05:00
eb3bbcb69e Check in 2025-06-12 04:32:18 -05:00
5066257912 Initial commit
checkpoint only
2025-06-12 02:18:27 -05:00
0535640e57 Starting version 2 2025-06-11 02:47:24 -05:00