Commit graph

29 commits

Author SHA1 Message Date
b319ef6f3f
irc/parser: fix lexer ownership, errors, and implication parsing
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I12a6b52ec1c0edff605d02393eafde896a6a6964
2026-04-24 23:13:23 +03:00
760094a2b7
irc: add flake reference support
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icc96d297f02d3aad03b0373727d57f316a6a6964
2026-04-24 23:13:22 +03:00
584d84542e
irc: add serialization support for patterns and string interpolation
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I244ae722016b5b49915e23522a1fb72e6a6a6964
2026-04-24 23:13:19 +03:00
0a5920adaf
irc: split parser into lexer and parser components
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4e73459a02caff5335d690656fd6f1396a6a6964
2026-04-24 23:13:19 +03:00
feb247f64a
irc: extract inline constructors; deduplicate value-copy logic
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ifc74f0bfe621a05fa7b91a5f6be1ea976a6a6964
2026-04-24 23:13:18 +03:00
28de44c598
irc: PrimOp memory leak and IR_VERSION mismatch
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iad057cd5f51ef26e7de93ccca7b3d3156a6a6964
2026-04-24 23:13:17 +03:00
f6481b3c01
irc/parser: use explicit IR nodes for patterns and interpolation
Replaces lambda pattern desugaring with direct `LambdaPatternNode`
generation, which:

- Separates required and optional fields in pattern structure
- Preserves @-binding and ellipsis information in IR
- Remove like 50 lines of Let-binding desugaring logic

and replace string interpolation concatenation tree with
`StringInterpolationNode` to:

- Use `StringPart::make_literal/make_expr` for cleaner representation
- Optimize single-literal strings to `ConstStringNode`
- Remove `toString` builtin wrapper generation

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I7d3fa038f743d02b9caae0979b79f5086a6a6964
2026-04-24 23:13:16 +03:00
359a707663
irc/types: IR type extensions
Updates IR_VERSION to 3. In an effort to support more features of the
Nix language, implements 5 new node type constants:

- `LAMBDA_PATTERN` = `0x70` - Lambda with pattern matching
- `INHERIT` = `0x71` - Simple inherit expressions
- `INHERIT_FROM` = `0x72` - Inherit from source expression
- `STRING_INTERPOLATION` = `0x73` - String with interpolated parts
- `BUILTIN_CALL` = `0x74` - Builtin function call

and some struct definitions before the Node class, such as `PatternField`.

Those will come in handy for suppporting the entire Nixpkgs library.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1f0e81a120a0c956b8068d81c42796616a6a6964
2026-04-24 23:13:15 +03:00
1ceb889a16
irc: add timing measurements; formatting
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id4402547e18b6569464850c3753383396a6a6964
2026-04-24 23:13:09 +03:00
54892c3121
irc/evaluator: fix variable lookup, recursive let, and value handling
Bunch of things:

- Decode depth and offset from encoded variable indices
- Pre-allocate Values for recursive let bindings before eval
- Use mk* methods for value copying instead of direct assignment
- Evaluate attrset values immediately to avoid dangling thunks

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4dd40c93d74df5973a642fb9f123e70e6a6a6964
2026-04-24 23:13:08 +03:00
e8fcaccacc
irc: add ListNode support; fix recursive attrset scoping
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1657bc6a05c264f0ae0dd2c94d32b1046a6a6964
2026-04-24 23:13:07 +03:00
51305298ee
irc/parser: fix list parsing and function application
Fixes bug where `concat [1 2 3] [4 5 6]` tried to apply integer 1
as a function.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6f373dd83bcac9e59286b0448472200b6a6a6964
2026-04-24 23:13:06 +03:00
8a093aa9e8
irc: improve multi-line strings; complete list concat and dynamic attrs
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I64e53c68d90b62f3ca306865ceda32af6a6a6964
2026-04-24 23:13:01 +03:00
dd79db1f86
irc: more syntax support
Indented strings, ancient let bindings and a bit more

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib86c2d8ca4402dfa0c5c536a9959f4006a6a6964
2026-04-24 23:12:59 +03:00
775bb42c63
irc: support lookup paths and import keyword
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0d16726646aef82ce675c4f8d209029a6a6a6964
2026-04-24 23:12:57 +03:00
3387e0d822
irc: support merge operator
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icfb0cc81542e637d4b91c6a5788370fb6a6a6964
2026-04-24 23:12:55 +03:00
95baf44a9c
irc: add Float and URI literal support
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I40c59d94f650e7b9e68f77598492d7ab6a6a6964
2026-04-24 23:12:54 +03:00
af17da34da chore: run through 'clang-tidy' with '-fix' 2026-02-24 19:40:05 +03:00
ea20aaab00 various: format with clang-format
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib9abc9d2dcd036d3680c5aa3dc919bfa6a6a6964
2026-02-24 19:40:05 +03:00
63a9eddc49
irc/evaluator: fix e passed by value in Thunk constructor
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If3bdfd1fc0851d4113b89827474a74a86a6a6964
2026-02-22 00:18:20 +03:00
f4135a5dca
types/serializer: add HasAttrNode binary encoding for ? operator
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibfb89151eb80ab1ae1d8878b6849d2c96a6a6964
2026-02-22 00:07:47 +03:00
3441853eef
various: fix string comparison, interpolation and ADD op. for strings
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ice1bfb5682ab48a967dc16f1378e23ae6a6a6964
2026-02-22 00:07:47 +03:00
22c92bfdd5
plugin: integrate evaluator for runtime comp
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1e43447957eb0c09b3ee7c2c21abe6496a6a6964
2026-02-22 00:07:43 +03:00
c32328f14d
evaulator: implement IR evaluation engine
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I980aaef64177b76620e3d1f9f39001046a6a6964
2026-02-22 00:07:42 +03:00
4b97433642
serializer: add HasAttrNode binary encoding
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ifdbd53aafc8291c78c273e2c9092fdf26a6a6964
2026-02-22 00:07:41 +03:00
a69385c5ca
ir-gen: add HasAttrNode conversion
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8e5bf04734112dc6e0885a42b4d546016a6a6964
2026-02-22 00:07:40 +03:00
59fedbe78d
types: add hasAttrNode for ? operator support
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I73691d86c8ce277bacc0dd7ed33939c96a6a6964
2026-02-22 00:07:39 +03:00
32f74c29fd
parser: add inherit keyword; initial string interpolation
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icdada04a72728e8881e2db4254bd88546a6a6964
2026-02-22 00:07:38 +03:00
618a58b2b8
initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1ad48ade1bc8234b7d7c9fe3d976a5be6a6a6964
2026-02-22 00:07:30 +03:00