uxn-tal 0.1.17

A Rust library for assembling TAL (Tal Assembly Language) files into UXN ROM files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use uxn_tal::{error::Result, lexer::Lexer};

fn main() -> Result<()> {
    let source = "|0000\n@direction $1\n\n|0100\n-direction\nBRK".to_string();
    println!("Source: {:?}", source);

    let mut lexer = Lexer::new(source, None);
    let tokens = lexer.tokenize()?;

    for (i, token) in tokens.iter().enumerate() {
        println!("Token {}: {:?}", i, token);
    }

    Ok(())
}