linked-syntax-tree

Crates.iolinked-syntax-tree
lib.rslinked-syntax-tree
version0.2.0
sourcesrc
created_at2023-06-10 23:23:04.53421
updated_at2023-07-14 23:31:58.09456
descriptionA doubly-linked syntax tree.
homepage
repositoryhttps://github.com/JonathanWoollett-Light/linked-syntax-tree
max_upload_size
id887125
size80,703
Jonathan Woollett-Light (JonathanWoollett-Light)

documentation

https://docs.rs/linked-syntax-tree/

README

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.

Commit count: 45

cargo fmt