Skip to content

monsieurbadia/uwa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

U.W.A

utils wit attitudes

About

a collection of simple macros that I use in my compilers.

Collections

use uwa::ch

is

match c {
  c if is!(eof c),
  c if is!(newline c),
  c if is!(quote c),
  c if is!(quote c),
  c if is!(single_quote c),
  c if is!(double_quote c),
  c if is!(number c),
  c if is!(zero c),
  c if is!(ident c),
  c if is!(underscore c),
  c => print!("\nunknown char"),
}

use uwa::file

read ~file

match read!(file "Cargo.toml") {
  Ok(f) => print!("\n{}", f),
  Err(e) => print!("\n", e),
}

read ~line

loop {
  match read!(line "Cargo.toml") {
    Ok(line) => print!("\n{}", line),
    Err(e) => print!("\n", e),
  }
}

use uwa::result

result_or ~die

fn parse(t: Token) {
  result_or!(die Ok(t))
}

About

utils wit attitudes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages