# Future Updates — OMLSP Integration

## Context

To replace `python-jq` with `rusty-jq` in [OMLSP](../OMLSP), two missing features need to be implemented.

## Missing Features

### 1. `tonumber` builtin

**Priority:** High

Used in OMLSP examples to convert string array elements to numbers:

```jq
.data[] | { start_time: (.[0] | tonumber), open: (.[1] | tonumber) }
```

**Implementation:**
- Add a `Tonumber` variant to `RustyFilter` enum
- Parse `tonumber` as a builtin filter in `parser.rs`
- In `engine.rs`, convert string values to i64/f64

### 2. Array slicing `[:N]`

**Priority:** High

Used extensively in OMLSP examples to limit array results:

```jq
.data.ticker[:2][] | {symbol, symbolName, buy, sell}
```

**Syntax to support:**
- `[:N]` — first N elements
- `[N:]` — from index N to end
- `[N:M]` — from index N to M

**Implementation:**
- Add a `Slice(Option<i32>, Option<i32>)` variant to `RustyFilter` enum
- Parse slice syntax `[start:end]` in `parser.rs`
- In `engine.rs`, return the sliced subarray

## Once Done

After implementing these two features, `rusty-jq` can fully replace `python-jq` in OMLSP with minimal code changes (~4 files).
