13 releases

0.2.0 Jul 14, 2023
0.1.11 Jun 15, 2023

#1475 in Data structures

Download history 3/week @ 2024-02-22 1/week @ 2024-02-29 2/week @ 2024-03-07 2/week @ 2024-03-14 54/week @ 2024-03-28 27/week @ 2024-04-04

81 downloads per month

Apache-2.0

81KB
1.5K SLoC

linked-syntax-tree

Crates.io docs

A doubly-linked syntax tree.

Offers functionality similar to std::collections::LinkedList.

Some code:

x = -10
loop
    x = x + 1
    if x
        break
x = 2

can be represented as:

┌──────────┐
│x = -10   │
└──────────┘
│
┌──────────┐
│loop      │
└──────────┘
│           ╲
┌──────────┐ ┌─────────┐
│x = 2     │ │x = x + 1│
└──────────┘ └─────────┘
             │
             ┌─────────┐
             │if x     │
             └─────────┘
                        ╲
                         ┌─────────┐
                         │break    │
                         └─────────┘

I personally am using this to contain an AST for compile-time evaluate.

No runtime deps