Commit 5de898d
fix(sustainabot): parse-blocking OCaml-isms and HANDLE-keyword name (Refs #148)
Two hand-port corrections after re-validating the ReScript→AffineScript
files against the live `affinescript check`:
1. **OCaml-style float operators** `/.`, `*.`, `+.`, `-.` → AffineScript
`/`, `*`, `+`, `-`. AffineScript uses unified arithmetic operators
for both Int and Float (see `examples/lessons/01_hello.affine`:
`subtotal * 0.08`), so the OCaml separation was a hand-port artefact.
Affected sites:
- `GitHubApp.affine`: `Time::now_millis() / 1000.0`,
`now_seconds - 60.0`, `now_seconds + 600.0`,
`Time::now_millis() + 60000.0`
- `Oikos.affine`: `60.0 * 60.0 * 1000.0`, `now - a.createdAt`
- `Report.affine`: `r.confidence * 100.0`
2. **`handle` is a contextual keyword** (HANDLE token, used in
`handle body { handlers }` effect expressions) and parses as a token,
not an ident, so it cannot be a function name. Renamed `Router.affine`
`pub fn handle(...)` → `pub fn dispatch(...)`. The function dispatches
a request to its matching route handler, so the rename is also a more
accurate name. The doc-comment is updated to match.
Result: with these edits + the four parser PRs gated on this issue
(hyperpolymath/affinescript#370, #371, #372, #373, #376), all 13
hand-ported `.affine` files reach Resolution (no parse errors) under
`affinescript check`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8a5f28f commit 5de898d
4 files changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments