Skip to content

Conversation

konard
Copy link
Member

@konard konard commented Sep 10, 2025

Summary

Implements issue #62 by adding support for optional arrow syntax in the Lino protocol.

  • Right arrow syntax: (1 → 2) equals (1 2)
  • Left arrow syntax: (2 ← 1) equals (1 2) (note the order reversal)
  • Backward compatible: All existing syntax continues to work unchanged

Implementation Details

Grammar Changes

  • C#: Updated Parser.peg with new arrowValues, rightArrowValues, and leftArrowValues rules
  • JavaScript: Updated grammar.pegjs with equivalent arrow parsing rules
  • Rust: Enhanced nom parser with arrow_values, right_arrow_values, and left_arrow_values functions

Syntax Examples

(1 2)       # Traditional syntax
(1 → 2)     # Right arrow - same result as above
(2 ← 1)     # Left arrow - same result as above (order reversed)
(papa → mama)   # Works with named references
(daughter ← papa) # Results in (papa daughter)

Version Updates

  • C# version: 0.6.0 → 0.7.0
  • JavaScript version: 0.6.0 → 0.7.0
  • Rust version: 0.6.0 → 0.7.0

Test Coverage

Added comprehensive test suites across all implementations:

  • C#: 4 new arrow syntax tests (all passing)
  • JavaScript: 4 new arrow syntax tests (all passing)
  • Rust: 4 new arrow syntax tests (all passing)

All existing tests continue to pass, ensuring full backward compatibility.

Test Results

C# Tests

Passed! - Failed: 0, Passed: 86, Skipped: 0, Total: 86

JavaScript Tests

84 pass, 0 fail, 211 expect() calls

Example Output

Input:  (2 ← 1)
Output: (1 2)

Input:  (1 → 2) 
Output: (1 2)

Input:  (1 2)
Output: (1 2)

🤖 Generated with Claude Code


Resolves #62

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #62
@konard konard self-assigned this Sep 10, 2025
konard and others added 2 commits September 10, 2025 13:12
Implements issue #62: Support for (2 ← 1) = (1 → 2) = (1 2)

Features:
- Added support for right arrow (→) syntax: (1 → 2) equals (1 2)
- Added support for left arrow (←) syntax: (2 ← 1) equals (1 2)
- Arrow syntax provides intuitive directional notation for links
- Fully backward compatible with existing syntax

Implementation:
- Updated C# PEG grammar (Parser.peg) with arrow value parsing
- Updated JavaScript PEG grammar (grammar.pegjs) with arrow support
- Updated Rust nom parser with arrow value functions
- Added comprehensive test coverage in all three languages

Version Updates:
- C# version: 0.6.0 → 0.7.0
- JavaScript version: 0.6.0 → 0.7.0
- Rust version: 0.6.0 → 0.7.0

All existing tests pass, new arrow syntax tests added and verified.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Add support for optional right or left arrow Add support for optional arrow syntax: (2 ← 1) = (1 → 2) = (1 2) Sep 10, 2025
@konard konard marked this pull request as ready for review September 10, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for optional right or left arrow

1 participant