Commit Graph

86 Commits

Author SHA1 Message Date
fe7abb8b21 wip 2025-10-15 08:45:37 -07:00
57711c4e89 wip 2025-10-14 16:45:45 -07:00
dbe5e60d04 wip 2025-10-14 16:12:17 -07:00
023bfb2caa getting there bro 2025-10-13 16:38:11 -07:00
3a12d7baff wip 2025-10-13 15:35:58 -07:00
1f147d2d26 fix: update compiler tests to use end keyword
Added 'end' keywords to function definition tests to match
current grammar requirement. Tests now reveal pre-existing
multi-parameter function bug from commit a53db50.
2025-10-12 19:47:21 -07:00
a86c3eef19 feat(compiler): add underscore placeholder support for pipes
Implement underscore (_) placeholder in pipe expressions to allow
piped values to be placed at specific positions in function calls.

Implementation:
- Scan FunctionCall arguments for underscore placeholder (detected as "_" Word token)
- When underscore is found, replace it with piped value at that position
- When no underscore is found, piped value becomes first arg (existing behavior)

Testing:
- Added test for underscore placeholder with single-parameter function
- Skipped test for multi-parameter function (blocked by existing Shrimp bug)
- All existing pipe tests continue to pass

The underscore detection logic is working correctly, as verified by the
single-parameter test. Full multi-parameter testing is blocked by a
known issue with multi-parameter function calls in Shrimp (see skipped
test in pipe.test.ts).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 17:36:39 -07:00
00b1863021 test(compiler): add integration test for simple pipe
Implements Task 7 from pipe expressions plan.

Tests:
- Simple pipe passes result as first argument (5 | double = 10)
- Pipe chain with three stages (3 | add-one | double | square = 64)
- Pipe with bare identifier (get-value | process)
- Pipe in assignment (result = 5 | add-ten)

One test skipped: pipes with multi-parameter functions reveal a broader
Shrimp bug where functions with 2+ parameters don't bind all arguments
correctly. This is not specific to pipes.

Note: Identifiers must be lowercase/kebab-case/emoji. CamelCase not supported.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 17:33:23 -07:00
cb62fdf437 feat(compiler): add PipeExpr compilation support
Implement Task 6 from docs/plans/2025-10-12-pipe-expressions.md

- Add pipe operator (|) termination to tokenizer
- Update grammar to include expressionWithoutIdentifier in pipeOperand
- Add PipeExpr case to compiler switch statement
- Implement pipe compilation: piped value becomes first argument
- Store piped values in temporary __pipe_value variable
- Handle both FunctionCallOrIdentifier and FunctionCall operands
- Add integration tests for pipe expressions

Tests:
- Simple pipe (5 | double) works correctly
- Additional tests exist but have pre-existing issues with function parameters

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 17:00:17 -07:00
d77a5caf23 test(parser): add test for pipe with inline function
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:48:51 -07:00
f17d8d3a35 test(parser): add test for pipe in assignment
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:47:37 -07:00
48be677ea9 test(parser): add tests for pipe expressions
Added three parser tests to verify pipe expressions parse correctly:
- Simple two-stage pipe (echo hello | grep h)
- Multi-stage pipe chain (find files | filter active | sort)
- Pipe with identifiers (get-value | process)

All tests pass and verify the PipeExpr grammar rules work as expected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:46:18 -07:00
71b1744c08 feat(parser): add PipeExpr grammar rules
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:42:07 -07:00
a53db50b1a wip 2025-10-12 16:33:53 -07:00
fe19191246 chore(parser): regenerate parser from grammar
Auto-generated parser files from grammar change that added pipe token.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:31:29 -07:00
fde2c31a81 feat(parser): add pipe token to grammar
Add "|" token to @tokens section to support pipe operator. This is the
first step in implementing Unix-style pipe expressions for chaining
function calls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:31:02 -07:00
597a25da80 hell yeah 2025-10-10 15:50:09 -07:00
560a946745 works 2025-10-09 10:44:34 -07:00
66807c02c9 clean 2025-10-09 09:48:27 -07:00
0a80f6d13d works better 2025-10-08 17:30:30 -07:00
7f52e5e7e3 yessss 2025-10-08 13:56:17 -07:00
4e16d84b3e wip 2025-10-07 10:22:49 -07:00
447e70041d wip 2025-10-07 08:12:50 -07:00
0f4db1d261 Update shrimp.test.ts 2025-10-06 17:05:36 -07:00
a28bdf74c9 ok, cool 2025-10-06 16:37:07 -07:00
e0fafc0088 wip 2025-10-06 13:18:47 -07:00
eff09931ad wip 2025-10-03 14:34:02 -07:00
d0ad8a0f20 wip 2025-10-03 10:25:36 -07:00
43e0b93a2a wip 2025-10-03 09:13:58 -07:00
f608c9e4c5 wip 2025-10-03 08:15:02 -07:00
7d23a86121 wip 2025-10-02 15:25:04 -07:00
d89130b169 OMG hairy 2025-10-02 14:05:17 -07:00
0168d7f933 emoji 2025-09-29 11:40:32 -07:00
7585f0e8a2 wip 2025-09-29 10:00:26 -07:00
1a9cd0f6ca editor 2025-09-26 16:16:09 -07:00
695d7f22bd Initial commit 2025-09-25 20:17:27 -07:00