diff --git a/README.md b/README.md index bba21d34..6fd3d9f5 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,152 @@ Sage advice for your coding conundrums!

- - + +

-[***Here's a link to the online compiler with a builtin virtual machine interpreter!***](https://adam-mcdaniel.net/sage) +[***Here's a link to the online compiler playground!***](https://adam-mcdaniel.net/sage) ## What is Sage? +Sage is a programming language that tries to be maximally portable, expressive, and intuitive. It borrows some aspects of Rust, C, and Python. It currently has an x86 compiler backend, a C source backend, and an interpreter backend [which can run on the web](https://adam-mcdaniel.net/sage). + +
+

+ + + +

+
+ +## Why Sage? + +Sage is very portable -- run it on your thermostat! Here's the complete list of core virtual machine instructions, and their C equivalents: + +| Instruction | C Equivalent | +| ----------- | --------------- | +| `while` | `while (reg) {` | +| `if` | `if (reg) {` | +| `else` | `} else {` | +| `end` | `}` | +| `set N` | `reg = N;` | +| `call` | `funs[reg]();` | +| `ret` | `return;` | +| `save` | `*tape_ptr = reg;` | +| `res` | `reg = *tape_ptr;` | +| `move N` | `tape_ptr += N;` | +| `where` | `reg = tape_ptr;` | +| `deref` | `push(tape_ptr); tape_ptr = *tape_ptr;` | +| `refer` | `tape_ptr = pop();` | +| `index` | `reg = (cell*)(reg) + *tape_ptr;` | +| `add` | `reg += *tape_ptr;` | +| `sub` | `reg -= *tape_ptr;` | +| `mul` | `reg *= *tape_ptr;` | +| `div` | `reg /= *tape_ptr;` | +| `rem` | `reg %= *tape_ptr;` | +| `gez` | `reg = reg >= 0;` | + +The compiler can target this limited instruction "core" set, with an expanded "standard" instruction set for floating point operations and foreign functions. The core instruction set is designed to be as simple as possible for anyone to implement their own backend. [Try to see if you can implement it yourself for your backend of choice!](https://github.com/adam-mcdaniel/sage/blob/main/src/targets/c.rs) + +## How useful is Sage? + +Sage is a very young project, and is not ready for production. It's still possible to write very useful programs in it, though. + +[SageOS is an operating system with a userspace written in Sage.](https://github.com/adam-mcdaniel/sage-os). The graphical shell and powerpoint presentation app (both written in Sage) use the FFI to draw to the screen, receive input from the mouse and keyboard, and interact with the filesystem. [You can look at the shell code here.](https://github.com/adam-mcdaniel/sage/tree/main/examples/sage-os/shell.sg) + +![Shell1](assets/shell1.png) +![Shell2](assets/shell2.png) + +The presentation app parses PPM image files from the filesystem and renders them to the screen. [You can look at the presentation code here](https://github.com/adam-mcdaniel/sage/tree/main/examples/sage-os/presentation.sg) + +![Presentation](assets/presentation.png) + +Go to the [web-demo](https://adam-mcdaniel.net/sage) or the [examples/frontend](https://github.com/adam-mcdaniel/sage/tree/main/examples/) folder to see more code examples. + +## How do I use Sage? + +To start using sage, install it with cargo: + +```sh +$ cargo install --git https://github.com/adam-mcdaniel/sage +``` + +Then, you can run a sage file with the `sage` command: + +```sh +$ sage examples/frontend/interactive-calculator.sg +``` + +You can also compile a sage file to C with the `--target` flag: + +```sh +$ sage examples/frontend/interactive-calculator.sg --target c +$ # Or `-t c` for short +$ sage examples/frontend/interactive-calculator.sg -tc +$ gcc out.c -o out +$ ./out +``` + +## Feature Roadmap + +- [x] Compiler Backends + - [x] x86 (semi-implemented and unoptimized) + - [ ] RISC-V + - [ ] ARM + - [ ] LLVM (highly desired!) + - [x] C (fully-implemented but unoptimized) + - [x] Interpreter (fully-implemented but unoptimized) + - [x] Web Backend + - [x] Interpreter + - [ ] Visual demo like the [web-demo](https://adam-mcdaniel.net/harbor) for [Harbor](https://github.com/adam-mcdaniel/harbor) +- [x] Static variables and constant expressions +- [x] Conditional compilation +- [x] Polymorphic functions +- [x] Mutability checks +- [x] Rust-like `enum`s +- [x] Pattern `match`ing +- [x] Structural typing +- [x] Recursive polymorphic types +- [ ] Iterators and list/vector/array comprehensions +- [ ] Hindley-Milner type inference +- [ ] Typeclasses +- [ ] Modules +- [ ] A standard library + - [ ] Collections + - [ ] Networking + - [ ] Filesystem + - [ ] Graphics + - [ ] Audio + - [ ] GUI + - [ ] WebAssembly + - [ ] Foreign Function Interface + - [ ] Memory Management +- [ ] A package manager +- [ ] AST Macros + +## How do I contribute? + +If you want to contribute, you can open an issue or a pull request. [Adding backends for other architectures is a great way to contribute!](https://github.com/adam-mcdaniel/sage/blob/main/src/targets/c.rs) + + + + + + + \ No newline at end of file diff --git a/assets/code1.png b/assets/code1.png new file mode 100644 index 00000000..10737461 Binary files /dev/null and b/assets/code1.png differ diff --git a/assets/code2.png b/assets/code2.png new file mode 100644 index 00000000..fecf45ae Binary files /dev/null and b/assets/code2.png differ diff --git a/assets/code3.png b/assets/code3.png new file mode 100644 index 00000000..cb2d08d1 Binary files /dev/null and b/assets/code3.png differ diff --git a/assets/presentation.png b/assets/presentation.png new file mode 100644 index 00000000..8cf727e5 Binary files /dev/null and b/assets/presentation.png differ diff --git a/assets/sage.png b/assets/sage.png new file mode 100644 index 00000000..8a4f42af Binary files /dev/null and b/assets/sage.png differ diff --git a/assets/shell1.png b/assets/shell1.png new file mode 100644 index 00000000..21b96fac Binary files /dev/null and b/assets/shell1.png differ diff --git a/assets/shell2.png b/assets/shell2.png new file mode 100644 index 00000000..482cf9cf Binary files /dev/null and b/assets/shell2.png differ diff --git a/docs/implementors/core/default/trait.Default.js b/docs/implementors/core/default/trait.Default.js index 77d1edd7..8dc939dd 100644 --- a/docs/implementors/core/default/trait.Default.js +++ b/docs/implementors/core/default/trait.Default.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"sage":[["impl Default for C"],["impl Default for TestingDevice"],["impl Default for CoreInterpreter<StandardDevice>"],["impl Default for Env"],["impl Default for Mutability"],["impl Default for CoreProgram"],["impl Default for CoreProgram"],["impl Default for X86"],["impl Default for MyOS"],["impl Default for StandardInterpreter<StandardDevice>"],["impl Default for StandardProgram"],["impl Default for StandardProgram"],["impl Default for Globals"],["impl Default for StandardDevice"]] +"sage":[["impl Default for C"],["impl Default for TestingDevice"],["impl Default for CoreInterpreter<StandardDevice>"],["impl Default for Env"],["impl Default for Mutability"],["impl Default for SageOS"],["impl Default for CoreProgram"],["impl Default for CoreProgram"],["impl Default for X86"],["impl Default for StandardInterpreter<StandardDevice>"],["impl Default for StandardProgram"],["impl Default for StandardProgram"],["impl Default for Globals"],["impl Default for StandardDevice"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/implementors/core/marker/trait.Freeze.js b/docs/implementors/core/marker/trait.Freeze.js index 36c36e3a..c80f420e 100644 --- a/docs/implementors/core/marker/trait.Freeze.js +++ b/docs/implementors/core/marker/trait.Freeze.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"sage":[["impl Freeze for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Freeze for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Freeze for Globals",1,["sage::asm::globals::Globals"]],["impl Freeze for Location",1,["sage::asm::location::Location"]],["impl Freeze for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Freeze for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Freeze for Error",1,["sage::asm::Error"]],["impl Freeze for Annotation",1,["sage::lir::annotate::Annotation"]],["impl Freeze for Env",1,["sage::lir::env::Env"]],["impl Freeze for Error",1,["sage::lir::error::Error"]],["impl Freeze for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl Freeze for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl Freeze for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Freeze for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Freeze for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Freeze for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl Freeze for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Freeze for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Freeze for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Freeze for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Freeze for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Freeze for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Freeze for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Freeze for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Freeze for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Freeze for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Freeze for And",1,["sage::lir::expr::ops::logic::And"]],["impl Freeze for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Freeze for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Freeze for New",1,["sage::lir::expr::ops::memory::New"]],["impl Freeze for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Freeze for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Freeze for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl Freeze for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Freeze for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Freeze for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Freeze for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl Freeze for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl Freeze for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Freeze for Mutability",1,["sage::lir::types::Mutability"]],["impl Freeze for Type",1,["sage::lir::types::Type"]],["impl Freeze for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Freeze for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Freeze for Axis",1,["sage::side_effects::io::Axis"]],["impl Freeze for Direction",1,["sage::side_effects::io::Direction"]],["impl Freeze for Color",1,["sage::side_effects::io::Color"]],["impl Freeze for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Freeze for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Freeze for Channel",1,["sage::side_effects::io::Channel"]],["impl Freeze for Input",1,["sage::side_effects::io::Input"]],["impl Freeze for Output",1,["sage::side_effects::io::Output"]],["impl Freeze for C",1,["sage::targets::c::C"]],["impl Freeze for MyOS",1,["sage::targets::my_os::MyOS"]],["impl Freeze for X86",1,["sage::targets::x86::X86"]],["impl Freeze for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Freeze for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Freeze for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Freeze for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Freeze for CoreInterpreter<T>where\n T: Freeze,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Freeze for StandardInterpreter<T>where\n T: Freeze,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Freeze for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Freeze for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Freeze for Error",1,["sage::vm::Error"]]] +"sage":[["impl Freeze for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Freeze for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Freeze for Globals",1,["sage::asm::globals::Globals"]],["impl Freeze for Location",1,["sage::asm::location::Location"]],["impl Freeze for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Freeze for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Freeze for Error",1,["sage::asm::Error"]],["impl Freeze for Annotation",1,["sage::lir::annotate::Annotation"]],["impl Freeze for Env",1,["sage::lir::env::Env"]],["impl Freeze for Error",1,["sage::lir::error::Error"]],["impl Freeze for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl Freeze for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl Freeze for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Freeze for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Freeze for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Freeze for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl Freeze for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Freeze for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Freeze for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Freeze for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Freeze for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Freeze for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Freeze for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Freeze for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Freeze for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Freeze for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Freeze for And",1,["sage::lir::expr::ops::logic::And"]],["impl Freeze for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Freeze for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Freeze for New",1,["sage::lir::expr::ops::memory::New"]],["impl Freeze for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Freeze for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Freeze for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl Freeze for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Freeze for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Freeze for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Freeze for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl Freeze for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl Freeze for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Freeze for Mutability",1,["sage::lir::types::Mutability"]],["impl Freeze for Type",1,["sage::lir::types::Type"]],["impl Freeze for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Freeze for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Freeze for Axis",1,["sage::side_effects::io::Axis"]],["impl Freeze for Direction",1,["sage::side_effects::io::Direction"]],["impl Freeze for Color",1,["sage::side_effects::io::Color"]],["impl Freeze for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Freeze for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Freeze for Channel",1,["sage::side_effects::io::Channel"]],["impl Freeze for Input",1,["sage::side_effects::io::Input"]],["impl Freeze for Output",1,["sage::side_effects::io::Output"]],["impl Freeze for C",1,["sage::targets::c::C"]],["impl Freeze for SageOS",1,["sage::targets::sage_os::SageOS"]],["impl Freeze for X86",1,["sage::targets::x86::X86"]],["impl Freeze for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Freeze for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Freeze for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Freeze for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Freeze for CoreInterpreter<T>where\n T: Freeze,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Freeze for StandardInterpreter<T>where\n T: Freeze,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Freeze for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Freeze for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Freeze for Error",1,["sage::vm::Error"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/implementors/core/marker/trait.Send.js b/docs/implementors/core/marker/trait.Send.js index 744b2e65..8fbb2d3b 100644 --- a/docs/implementors/core/marker/trait.Send.js +++ b/docs/implementors/core/marker/trait.Send.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"sage":[["impl Send for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Send for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Send for Globals",1,["sage::asm::globals::Globals"]],["impl Send for Location",1,["sage::asm::location::Location"]],["impl Send for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Send for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Send for Error",1,["sage::asm::Error"]],["impl Send for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !Send for Env",1,["sage::lir::env::Env"]],["impl !Send for Error",1,["sage::lir::error::Error"]],["impl !Send for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !Send for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !Send for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Send for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Send for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Send for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !Send for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Send for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Send for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Send for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Send for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Send for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Send for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Send for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Send for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Send for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Send for And",1,["sage::lir::expr::ops::logic::And"]],["impl Send for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Send for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Send for New",1,["sage::lir::expr::ops::memory::New"]],["impl Send for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Send for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Send for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !Send for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Send for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Send for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Send for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !Send for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !Send for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Send for Mutability",1,["sage::lir::types::Mutability"]],["impl Send for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Send for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Send for Axis",1,["sage::side_effects::io::Axis"]],["impl Send for Direction",1,["sage::side_effects::io::Direction"]],["impl Send for Color",1,["sage::side_effects::io::Color"]],["impl Send for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Send for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Send for Channel",1,["sage::side_effects::io::Channel"]],["impl Send for Input",1,["sage::side_effects::io::Input"]],["impl Send for Output",1,["sage::side_effects::io::Output"]],["impl Send for C",1,["sage::targets::c::C"]],["impl Send for MyOS",1,["sage::targets::my_os::MyOS"]],["impl Send for X86",1,["sage::targets::x86::X86"]],["impl Send for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Send for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Send for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Send for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Send for CoreInterpreter<T>where\n T: Send,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Send for StandardInterpreter<T>where\n T: Send,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Send for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Send for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Send for Error",1,["sage::vm::Error"]],["impl Send for Type"]] +"sage":[["impl Send for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Send for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Send for Globals",1,["sage::asm::globals::Globals"]],["impl Send for Location",1,["sage::asm::location::Location"]],["impl Send for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Send for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Send for Error",1,["sage::asm::Error"]],["impl Send for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !Send for Env",1,["sage::lir::env::Env"]],["impl !Send for Error",1,["sage::lir::error::Error"]],["impl !Send for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !Send for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !Send for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Send for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Send for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Send for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !Send for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Send for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Send for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Send for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Send for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Send for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Send for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Send for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Send for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Send for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Send for And",1,["sage::lir::expr::ops::logic::And"]],["impl Send for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Send for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Send for New",1,["sage::lir::expr::ops::memory::New"]],["impl Send for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Send for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Send for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !Send for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Send for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Send for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Send for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !Send for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !Send for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Send for Mutability",1,["sage::lir::types::Mutability"]],["impl Send for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Send for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Send for Axis",1,["sage::side_effects::io::Axis"]],["impl Send for Direction",1,["sage::side_effects::io::Direction"]],["impl Send for Color",1,["sage::side_effects::io::Color"]],["impl Send for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Send for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Send for Channel",1,["sage::side_effects::io::Channel"]],["impl Send for Input",1,["sage::side_effects::io::Input"]],["impl Send for Output",1,["sage::side_effects::io::Output"]],["impl Send for C",1,["sage::targets::c::C"]],["impl Send for SageOS",1,["sage::targets::sage_os::SageOS"]],["impl Send for X86",1,["sage::targets::x86::X86"]],["impl Send for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Send for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Send for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Send for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Send for CoreInterpreter<T>where\n T: Send,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Send for StandardInterpreter<T>where\n T: Send,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Send for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Send for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Send for Error",1,["sage::vm::Error"]],["impl Send for Type"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/implementors/core/marker/trait.Sync.js b/docs/implementors/core/marker/trait.Sync.js index c23ff46a..94c830c8 100644 --- a/docs/implementors/core/marker/trait.Sync.js +++ b/docs/implementors/core/marker/trait.Sync.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"sage":[["impl Sync for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Sync for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Sync for Globals",1,["sage::asm::globals::Globals"]],["impl Sync for Location",1,["sage::asm::location::Location"]],["impl Sync for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Sync for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Sync for Error",1,["sage::asm::Error"]],["impl Sync for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !Sync for Env",1,["sage::lir::env::Env"]],["impl !Sync for Error",1,["sage::lir::error::Error"]],["impl !Sync for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !Sync for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !Sync for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Sync for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Sync for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Sync for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !Sync for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Sync for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Sync for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Sync for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Sync for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Sync for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Sync for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Sync for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Sync for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Sync for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Sync for And",1,["sage::lir::expr::ops::logic::And"]],["impl Sync for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Sync for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Sync for New",1,["sage::lir::expr::ops::memory::New"]],["impl Sync for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Sync for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Sync for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !Sync for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Sync for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Sync for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Sync for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !Sync for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !Sync for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Sync for Mutability",1,["sage::lir::types::Mutability"]],["impl Sync for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Sync for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Sync for Axis",1,["sage::side_effects::io::Axis"]],["impl Sync for Direction",1,["sage::side_effects::io::Direction"]],["impl Sync for Color",1,["sage::side_effects::io::Color"]],["impl Sync for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Sync for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Sync for Channel",1,["sage::side_effects::io::Channel"]],["impl Sync for Input",1,["sage::side_effects::io::Input"]],["impl Sync for Output",1,["sage::side_effects::io::Output"]],["impl Sync for C",1,["sage::targets::c::C"]],["impl Sync for MyOS",1,["sage::targets::my_os::MyOS"]],["impl Sync for X86",1,["sage::targets::x86::X86"]],["impl Sync for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Sync for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Sync for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Sync for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Sync for CoreInterpreter<T>where\n T: Sync,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Sync for StandardInterpreter<T>where\n T: Sync,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Sync for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Sync for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Sync for Error",1,["sage::vm::Error"]],["impl Sync for Type"]] +"sage":[["impl Sync for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Sync for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Sync for Globals",1,["sage::asm::globals::Globals"]],["impl Sync for Location",1,["sage::asm::location::Location"]],["impl Sync for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Sync for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Sync for Error",1,["sage::asm::Error"]],["impl Sync for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !Sync for Env",1,["sage::lir::env::Env"]],["impl !Sync for Error",1,["sage::lir::error::Error"]],["impl !Sync for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !Sync for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !Sync for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Sync for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Sync for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Sync for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !Sync for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Sync for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Sync for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Sync for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Sync for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Sync for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Sync for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Sync for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Sync for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Sync for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Sync for And",1,["sage::lir::expr::ops::logic::And"]],["impl Sync for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Sync for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Sync for New",1,["sage::lir::expr::ops::memory::New"]],["impl Sync for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Sync for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Sync for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !Sync for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Sync for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Sync for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Sync for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !Sync for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !Sync for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Sync for Mutability",1,["sage::lir::types::Mutability"]],["impl Sync for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Sync for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Sync for Axis",1,["sage::side_effects::io::Axis"]],["impl Sync for Direction",1,["sage::side_effects::io::Direction"]],["impl Sync for Color",1,["sage::side_effects::io::Color"]],["impl Sync for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Sync for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Sync for Channel",1,["sage::side_effects::io::Channel"]],["impl Sync for Input",1,["sage::side_effects::io::Input"]],["impl Sync for Output",1,["sage::side_effects::io::Output"]],["impl Sync for C",1,["sage::targets::c::C"]],["impl Sync for SageOS",1,["sage::targets::sage_os::SageOS"]],["impl Sync for X86",1,["sage::targets::x86::X86"]],["impl Sync for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Sync for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Sync for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Sync for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Sync for CoreInterpreter<T>where\n T: Sync,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Sync for StandardInterpreter<T>where\n T: Sync,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Sync for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Sync for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Sync for Error",1,["sage::vm::Error"]],["impl Sync for Type"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/implementors/core/marker/trait.Unpin.js b/docs/implementors/core/marker/trait.Unpin.js index 0dba1bef..cbade463 100644 --- a/docs/implementors/core/marker/trait.Unpin.js +++ b/docs/implementors/core/marker/trait.Unpin.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"sage":[["impl Unpin for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Unpin for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Unpin for Globals",1,["sage::asm::globals::Globals"]],["impl Unpin for Location",1,["sage::asm::location::Location"]],["impl Unpin for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Unpin for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Unpin for Error",1,["sage::asm::Error"]],["impl Unpin for Annotation",1,["sage::lir::annotate::Annotation"]],["impl Unpin for Env",1,["sage::lir::env::Env"]],["impl Unpin for Error",1,["sage::lir::error::Error"]],["impl Unpin for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl Unpin for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl Unpin for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Unpin for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Unpin for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Unpin for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl Unpin for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Unpin for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Unpin for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Unpin for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Unpin for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Unpin for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Unpin for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Unpin for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Unpin for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Unpin for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Unpin for And",1,["sage::lir::expr::ops::logic::And"]],["impl Unpin for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Unpin for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Unpin for New",1,["sage::lir::expr::ops::memory::New"]],["impl Unpin for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Unpin for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Unpin for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl Unpin for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Unpin for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Unpin for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Unpin for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl Unpin for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl Unpin for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Unpin for Mutability",1,["sage::lir::types::Mutability"]],["impl Unpin for Type",1,["sage::lir::types::Type"]],["impl Unpin for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Unpin for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Unpin for Axis",1,["sage::side_effects::io::Axis"]],["impl Unpin for Direction",1,["sage::side_effects::io::Direction"]],["impl Unpin for Color",1,["sage::side_effects::io::Color"]],["impl Unpin for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Unpin for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Unpin for Channel",1,["sage::side_effects::io::Channel"]],["impl Unpin for Input",1,["sage::side_effects::io::Input"]],["impl Unpin for Output",1,["sage::side_effects::io::Output"]],["impl Unpin for C",1,["sage::targets::c::C"]],["impl Unpin for MyOS",1,["sage::targets::my_os::MyOS"]],["impl Unpin for X86",1,["sage::targets::x86::X86"]],["impl Unpin for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Unpin for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Unpin for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Unpin for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Unpin for CoreInterpreter<T>where\n T: Unpin,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Unpin for StandardInterpreter<T>where\n T: Unpin,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Unpin for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Unpin for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Unpin for Error",1,["sage::vm::Error"]]] +"sage":[["impl Unpin for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl Unpin for CoreOp",1,["sage::asm::core::CoreOp"]],["impl Unpin for Globals",1,["sage::asm::globals::Globals"]],["impl Unpin for Location",1,["sage::asm::location::Location"]],["impl Unpin for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl Unpin for StandardOp",1,["sage::asm::std::StandardOp"]],["impl Unpin for Error",1,["sage::asm::Error"]],["impl Unpin for Annotation",1,["sage::lir::annotate::Annotation"]],["impl Unpin for Env",1,["sage::lir::env::Env"]],["impl Unpin for Error",1,["sage::lir::error::Error"]],["impl Unpin for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl Unpin for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl Unpin for Expr",1,["sage::lir::expr::expression::Expr"]],["impl Unpin for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl Unpin for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl Unpin for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl Unpin for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl Unpin for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl Unpin for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl Unpin for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl Unpin for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl Unpin for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl Unpin for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl Unpin for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl Unpin for Get",1,["sage::lir::expr::ops::io::Get"]],["impl Unpin for Put",1,["sage::lir::expr::ops::io::Put"]],["impl Unpin for And",1,["sage::lir::expr::ops::logic::And"]],["impl Unpin for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl Unpin for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl Unpin for New",1,["sage::lir::expr::ops::memory::New"]],["impl Unpin for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl Unpin for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl Unpin for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl Unpin for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl Unpin for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl Unpin for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl Unpin for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl Unpin for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl Unpin for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl Unpin for Mutability",1,["sage::lir::types::Mutability"]],["impl Unpin for Type",1,["sage::lir::types::Type"]],["impl Unpin for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl Unpin for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl Unpin for Axis",1,["sage::side_effects::io::Axis"]],["impl Unpin for Direction",1,["sage::side_effects::io::Direction"]],["impl Unpin for Color",1,["sage::side_effects::io::Color"]],["impl Unpin for InputMode",1,["sage::side_effects::io::InputMode"]],["impl Unpin for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl Unpin for Channel",1,["sage::side_effects::io::Channel"]],["impl Unpin for Input",1,["sage::side_effects::io::Input"]],["impl Unpin for Output",1,["sage::side_effects::io::Output"]],["impl Unpin for C",1,["sage::targets::c::C"]],["impl Unpin for SageOS",1,["sage::targets::sage_os::SageOS"]],["impl Unpin for X86",1,["sage::targets::x86::X86"]],["impl Unpin for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl Unpin for CoreOp",1,["sage::vm::core::CoreOp"]],["impl Unpin for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl Unpin for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> Unpin for CoreInterpreter<T>where\n T: Unpin,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> Unpin for StandardInterpreter<T>where\n T: Unpin,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl Unpin for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl Unpin for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl Unpin for Error",1,["sage::vm::Error"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/docs/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js index d81819dd..3117e4b3 100644 --- a/docs/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/docs/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"sage":[["impl RefUnwindSafe for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl RefUnwindSafe for CoreOp",1,["sage::asm::core::CoreOp"]],["impl RefUnwindSafe for Globals",1,["sage::asm::globals::Globals"]],["impl RefUnwindSafe for Location",1,["sage::asm::location::Location"]],["impl RefUnwindSafe for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl RefUnwindSafe for StandardOp",1,["sage::asm::std::StandardOp"]],["impl RefUnwindSafe for Error",1,["sage::asm::Error"]],["impl RefUnwindSafe for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !RefUnwindSafe for Env",1,["sage::lir::env::Env"]],["impl !RefUnwindSafe for Error",1,["sage::lir::error::Error"]],["impl !RefUnwindSafe for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !RefUnwindSafe for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !RefUnwindSafe for Expr",1,["sage::lir::expr::expression::Expr"]],["impl RefUnwindSafe for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl RefUnwindSafe for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl RefUnwindSafe for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !RefUnwindSafe for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl RefUnwindSafe for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl RefUnwindSafe for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl RefUnwindSafe for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl RefUnwindSafe for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl RefUnwindSafe for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl RefUnwindSafe for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl RefUnwindSafe for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl RefUnwindSafe for Get",1,["sage::lir::expr::ops::io::Get"]],["impl RefUnwindSafe for Put",1,["sage::lir::expr::ops::io::Put"]],["impl RefUnwindSafe for And",1,["sage::lir::expr::ops::logic::And"]],["impl RefUnwindSafe for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl RefUnwindSafe for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl RefUnwindSafe for New",1,["sage::lir::expr::ops::memory::New"]],["impl RefUnwindSafe for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl RefUnwindSafe for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl RefUnwindSafe for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !RefUnwindSafe for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl !RefUnwindSafe for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl !RefUnwindSafe for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl !RefUnwindSafe for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !RefUnwindSafe for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !RefUnwindSafe for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl RefUnwindSafe for Mutability",1,["sage::lir::types::Mutability"]],["impl !RefUnwindSafe for Type",1,["sage::lir::types::Type"]],["impl RefUnwindSafe for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl RefUnwindSafe for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl RefUnwindSafe for Axis",1,["sage::side_effects::io::Axis"]],["impl RefUnwindSafe for Direction",1,["sage::side_effects::io::Direction"]],["impl RefUnwindSafe for Color",1,["sage::side_effects::io::Color"]],["impl RefUnwindSafe for InputMode",1,["sage::side_effects::io::InputMode"]],["impl RefUnwindSafe for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl RefUnwindSafe for Channel",1,["sage::side_effects::io::Channel"]],["impl RefUnwindSafe for Input",1,["sage::side_effects::io::Input"]],["impl RefUnwindSafe for Output",1,["sage::side_effects::io::Output"]],["impl RefUnwindSafe for C",1,["sage::targets::c::C"]],["impl RefUnwindSafe for MyOS",1,["sage::targets::my_os::MyOS"]],["impl RefUnwindSafe for X86",1,["sage::targets::x86::X86"]],["impl RefUnwindSafe for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl RefUnwindSafe for CoreOp",1,["sage::vm::core::CoreOp"]],["impl RefUnwindSafe for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl RefUnwindSafe for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> RefUnwindSafe for CoreInterpreter<T>where\n T: RefUnwindSafe,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> RefUnwindSafe for StandardInterpreter<T>where\n T: RefUnwindSafe,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl RefUnwindSafe for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl RefUnwindSafe for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl RefUnwindSafe for Error",1,["sage::vm::Error"]]] +"sage":[["impl RefUnwindSafe for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl RefUnwindSafe for CoreOp",1,["sage::asm::core::CoreOp"]],["impl RefUnwindSafe for Globals",1,["sage::asm::globals::Globals"]],["impl RefUnwindSafe for Location",1,["sage::asm::location::Location"]],["impl RefUnwindSafe for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl RefUnwindSafe for StandardOp",1,["sage::asm::std::StandardOp"]],["impl RefUnwindSafe for Error",1,["sage::asm::Error"]],["impl RefUnwindSafe for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !RefUnwindSafe for Env",1,["sage::lir::env::Env"]],["impl !RefUnwindSafe for Error",1,["sage::lir::error::Error"]],["impl !RefUnwindSafe for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !RefUnwindSafe for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !RefUnwindSafe for Expr",1,["sage::lir::expr::expression::Expr"]],["impl RefUnwindSafe for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl RefUnwindSafe for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl RefUnwindSafe for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !RefUnwindSafe for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl RefUnwindSafe for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl RefUnwindSafe for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl RefUnwindSafe for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl RefUnwindSafe for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl RefUnwindSafe for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl RefUnwindSafe for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl RefUnwindSafe for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl RefUnwindSafe for Get",1,["sage::lir::expr::ops::io::Get"]],["impl RefUnwindSafe for Put",1,["sage::lir::expr::ops::io::Put"]],["impl RefUnwindSafe for And",1,["sage::lir::expr::ops::logic::And"]],["impl RefUnwindSafe for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl RefUnwindSafe for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl RefUnwindSafe for New",1,["sage::lir::expr::ops::memory::New"]],["impl RefUnwindSafe for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl RefUnwindSafe for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl RefUnwindSafe for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !RefUnwindSafe for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl !RefUnwindSafe for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl !RefUnwindSafe for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl !RefUnwindSafe for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !RefUnwindSafe for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !RefUnwindSafe for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl RefUnwindSafe for Mutability",1,["sage::lir::types::Mutability"]],["impl !RefUnwindSafe for Type",1,["sage::lir::types::Type"]],["impl RefUnwindSafe for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl RefUnwindSafe for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl RefUnwindSafe for Axis",1,["sage::side_effects::io::Axis"]],["impl RefUnwindSafe for Direction",1,["sage::side_effects::io::Direction"]],["impl RefUnwindSafe for Color",1,["sage::side_effects::io::Color"]],["impl RefUnwindSafe for InputMode",1,["sage::side_effects::io::InputMode"]],["impl RefUnwindSafe for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl RefUnwindSafe for Channel",1,["sage::side_effects::io::Channel"]],["impl RefUnwindSafe for Input",1,["sage::side_effects::io::Input"]],["impl RefUnwindSafe for Output",1,["sage::side_effects::io::Output"]],["impl RefUnwindSafe for C",1,["sage::targets::c::C"]],["impl RefUnwindSafe for SageOS",1,["sage::targets::sage_os::SageOS"]],["impl RefUnwindSafe for X86",1,["sage::targets::x86::X86"]],["impl RefUnwindSafe for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl RefUnwindSafe for CoreOp",1,["sage::vm::core::CoreOp"]],["impl RefUnwindSafe for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl RefUnwindSafe for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> RefUnwindSafe for CoreInterpreter<T>where\n T: RefUnwindSafe,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> RefUnwindSafe for StandardInterpreter<T>where\n T: RefUnwindSafe,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl RefUnwindSafe for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl RefUnwindSafe for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl RefUnwindSafe for Error",1,["sage::vm::Error"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/docs/implementors/core/panic/unwind_safe/trait.UnwindSafe.js index e1258032..b0c6b041 100644 --- a/docs/implementors/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/docs/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"sage":[["impl UnwindSafe for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl UnwindSafe for CoreOp",1,["sage::asm::core::CoreOp"]],["impl UnwindSafe for Globals",1,["sage::asm::globals::Globals"]],["impl UnwindSafe for Location",1,["sage::asm::location::Location"]],["impl UnwindSafe for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl UnwindSafe for StandardOp",1,["sage::asm::std::StandardOp"]],["impl UnwindSafe for Error",1,["sage::asm::Error"]],["impl UnwindSafe for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !UnwindSafe for Env",1,["sage::lir::env::Env"]],["impl !UnwindSafe for Error",1,["sage::lir::error::Error"]],["impl !UnwindSafe for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !UnwindSafe for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !UnwindSafe for Expr",1,["sage::lir::expr::expression::Expr"]],["impl UnwindSafe for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl UnwindSafe for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl UnwindSafe for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !UnwindSafe for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl UnwindSafe for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl UnwindSafe for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl UnwindSafe for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl UnwindSafe for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl UnwindSafe for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl UnwindSafe for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl UnwindSafe for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl UnwindSafe for Get",1,["sage::lir::expr::ops::io::Get"]],["impl UnwindSafe for Put",1,["sage::lir::expr::ops::io::Put"]],["impl UnwindSafe for And",1,["sage::lir::expr::ops::logic::And"]],["impl UnwindSafe for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl UnwindSafe for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl UnwindSafe for New",1,["sage::lir::expr::ops::memory::New"]],["impl UnwindSafe for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl UnwindSafe for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl UnwindSafe for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !UnwindSafe for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl !UnwindSafe for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl !UnwindSafe for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl !UnwindSafe for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !UnwindSafe for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !UnwindSafe for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl UnwindSafe for Mutability",1,["sage::lir::types::Mutability"]],["impl !UnwindSafe for Type",1,["sage::lir::types::Type"]],["impl UnwindSafe for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl UnwindSafe for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl UnwindSafe for Axis",1,["sage::side_effects::io::Axis"]],["impl UnwindSafe for Direction",1,["sage::side_effects::io::Direction"]],["impl UnwindSafe for Color",1,["sage::side_effects::io::Color"]],["impl UnwindSafe for InputMode",1,["sage::side_effects::io::InputMode"]],["impl UnwindSafe for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl UnwindSafe for Channel",1,["sage::side_effects::io::Channel"]],["impl UnwindSafe for Input",1,["sage::side_effects::io::Input"]],["impl UnwindSafe for Output",1,["sage::side_effects::io::Output"]],["impl UnwindSafe for C",1,["sage::targets::c::C"]],["impl UnwindSafe for MyOS",1,["sage::targets::my_os::MyOS"]],["impl UnwindSafe for X86",1,["sage::targets::x86::X86"]],["impl UnwindSafe for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl UnwindSafe for CoreOp",1,["sage::vm::core::CoreOp"]],["impl UnwindSafe for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl UnwindSafe for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> UnwindSafe for CoreInterpreter<T>where\n T: UnwindSafe,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> UnwindSafe for StandardInterpreter<T>where\n T: UnwindSafe,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl UnwindSafe for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl UnwindSafe for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl UnwindSafe for Error",1,["sage::vm::Error"]]] +"sage":[["impl UnwindSafe for CoreProgram",1,["sage::asm::core::CoreProgram"]],["impl UnwindSafe for CoreOp",1,["sage::asm::core::CoreOp"]],["impl UnwindSafe for Globals",1,["sage::asm::globals::Globals"]],["impl UnwindSafe for Location",1,["sage::asm::location::Location"]],["impl UnwindSafe for StandardProgram",1,["sage::asm::std::StandardProgram"]],["impl UnwindSafe for StandardOp",1,["sage::asm::std::StandardOp"]],["impl UnwindSafe for Error",1,["sage::asm::Error"]],["impl UnwindSafe for Annotation",1,["sage::lir::annotate::Annotation"]],["impl !UnwindSafe for Env",1,["sage::lir::env::Env"]],["impl !UnwindSafe for Error",1,["sage::lir::error::Error"]],["impl !UnwindSafe for ConstExpr",1,["sage::lir::expr::const_expr::ConstExpr"]],["impl !UnwindSafe for Declaration",1,["sage::lir::expr::declaration::Declaration"]],["impl !UnwindSafe for Expr",1,["sage::lir::expr::expression::Expr"]],["impl UnwindSafe for Add",1,["sage::lir::expr::ops::arithmetic::addition::Add"]],["impl UnwindSafe for Negate",1,["sage::lir::expr::ops::arithmetic::negate::Negate"]],["impl UnwindSafe for Arithmetic",1,["sage::lir::expr::ops::arithmetic::Arithmetic"]],["impl !UnwindSafe for Assign",1,["sage::lir::expr::ops::assign::Assign"]],["impl UnwindSafe for BitwiseAnd",1,["sage::lir::expr::ops::bitwise::and::BitwiseAnd"]],["impl UnwindSafe for BitwiseNand",1,["sage::lir::expr::ops::bitwise::nand::BitwiseNand"]],["impl UnwindSafe for BitwiseNor",1,["sage::lir::expr::ops::bitwise::nor::BitwiseNor"]],["impl UnwindSafe for BitwiseNot",1,["sage::lir::expr::ops::bitwise::not::BitwiseNot"]],["impl UnwindSafe for BitwiseOr",1,["sage::lir::expr::ops::bitwise::or::BitwiseOr"]],["impl UnwindSafe for BitwiseXor",1,["sage::lir::expr::ops::bitwise::xor::BitwiseXor"]],["impl UnwindSafe for Comparison",1,["sage::lir::expr::ops::comparison::Comparison"]],["impl UnwindSafe for Get",1,["sage::lir::expr::ops::io::Get"]],["impl UnwindSafe for Put",1,["sage::lir::expr::ops::io::Put"]],["impl UnwindSafe for And",1,["sage::lir::expr::ops::logic::And"]],["impl UnwindSafe for Or",1,["sage::lir::expr::ops::logic::Or"]],["impl UnwindSafe for Not",1,["sage::lir::expr::ops::logic::Not"]],["impl UnwindSafe for New",1,["sage::lir::expr::ops::memory::New"]],["impl UnwindSafe for Delete",1,["sage::lir::expr::ops::memory::Delete"]],["impl UnwindSafe for Tag",1,["sage::lir::expr::ops::tagged_union::Tag"]],["impl UnwindSafe for Data",1,["sage::lir::expr::ops::tagged_union::Data"]],["impl !UnwindSafe for Pattern",1,["sage::lir::expr::pattern::Pattern"]],["impl !UnwindSafe for CoreBuiltin",1,["sage::lir::expr::procedure::builtin::CoreBuiltin"]],["impl !UnwindSafe for StandardBuiltin",1,["sage::lir::expr::procedure::builtin::StandardBuiltin"]],["impl !UnwindSafe for FFIProcedure",1,["sage::lir::expr::procedure::ffi::FFIProcedure"]],["impl !UnwindSafe for Procedure",1,["sage::lir::expr::procedure::mono::Procedure"]],["impl !UnwindSafe for PolyProcedure",1,["sage::lir::expr::procedure::poly::PolyProcedure"]],["impl UnwindSafe for Mutability",1,["sage::lir::types::Mutability"]],["impl !UnwindSafe for Type",1,["sage::lir::types::Type"]],["impl UnwindSafe for SourceCodeLocation",1,["sage::parse::SourceCodeLocation"]],["impl UnwindSafe for FFIBinding",1,["sage::side_effects::ffi::FFIBinding"]],["impl UnwindSafe for Axis",1,["sage::side_effects::io::Axis"]],["impl UnwindSafe for Direction",1,["sage::side_effects::io::Direction"]],["impl UnwindSafe for Color",1,["sage::side_effects::io::Color"]],["impl UnwindSafe for InputMode",1,["sage::side_effects::io::InputMode"]],["impl UnwindSafe for OutputMode",1,["sage::side_effects::io::OutputMode"]],["impl UnwindSafe for Channel",1,["sage::side_effects::io::Channel"]],["impl UnwindSafe for Input",1,["sage::side_effects::io::Input"]],["impl UnwindSafe for Output",1,["sage::side_effects::io::Output"]],["impl UnwindSafe for C",1,["sage::targets::c::C"]],["impl UnwindSafe for SageOS",1,["sage::targets::sage_os::SageOS"]],["impl UnwindSafe for X86",1,["sage::targets::x86::X86"]],["impl UnwindSafe for CoreProgram",1,["sage::vm::core::CoreProgram"]],["impl UnwindSafe for CoreOp",1,["sage::vm::core::CoreOp"]],["impl UnwindSafe for StandardProgram",1,["sage::vm::std::StandardProgram"]],["impl UnwindSafe for StandardOp",1,["sage::vm::std::StandardOp"]],["impl<T> UnwindSafe for CoreInterpreter<T>where\n T: UnwindSafe,",1,["sage::vm::interpreter::core::CoreInterpreter"]],["impl<T> UnwindSafe for StandardInterpreter<T>where\n T: UnwindSafe,",1,["sage::vm::interpreter::std::StandardInterpreter"]],["impl UnwindSafe for TestingDevice",1,["sage::vm::interpreter::TestingDevice"]],["impl UnwindSafe for StandardDevice",1,["sage::vm::interpreter::StandardDevice"]],["impl UnwindSafe for Error",1,["sage::vm::Error"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/sage/all.html b/docs/sage/all.html index fc0e27e0..3b9707d7 100644 --- a/docs/sage/all.html +++ b/docs/sage/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

Functions

Constants

\ No newline at end of file +List of all items in this crate

List of all items

Structs

Enums

Traits

Functions

Constants

\ No newline at end of file diff --git a/docs/sage/constant.LOGO.html b/docs/sage/constant.LOGO.html index 8bcfcb03..61e7ac3b 100644 --- a/docs/sage/constant.LOGO.html +++ b/docs/sage/constant.LOGO.html @@ -1,4 +1,4 @@ -LOGO in sage - Rust

Constant sage::LOGO

source ·
pub const LOGO: &str = r#"
+LOGO in sage - Rust

Constant sage::LOGO

source ·
pub const LOGO: &str = r#"
    █████   ██████    ███████  ██████   `-.        _.-'
   ███░░   ░░░░░███  ███░░███ ███░░███   \ `,    .'/.'
  ░░█████   ███████ ░███ ░███░███████     \`.`. :.-'.-= .-'/
diff --git a/docs/sage/constant.LOGO_WITH_COLOR.html b/docs/sage/constant.LOGO_WITH_COLOR.html
index 5c4563b1..15a4ba77 100644
--- a/docs/sage/constant.LOGO_WITH_COLOR.html
+++ b/docs/sage/constant.LOGO_WITH_COLOR.html
@@ -1,4 +1,4 @@
-LOGO_WITH_COLOR in sage - Rust

Constant sage::LOGO_WITH_COLOR

source ·
pub const LOGO_WITH_COLOR: &str = "\x1b[32m
+LOGO_WITH_COLOR in sage - Rust

Constant sage::LOGO_WITH_COLOR

source ·
pub const LOGO_WITH_COLOR: &str = "\x1b[32m
    █████   ██████    ███████  ██████   `-.        _.-'
   ███░░   ░░░░░███  ███░░███ ███░░███   \\ `,    .'/.'
  ░░█████   ███████ ░███ ░███░███████     \\`.`. :.-'.-= .-'/
diff --git a/docs/sage/constant.NULL.html b/docs/sage/constant.NULL.html
index b141d782..1e740aca 100644
--- a/docs/sage/constant.NULL.html
+++ b/docs/sage/constant.NULL.html
@@ -1,4 +1,4 @@
-NULL in sage - Rust

Constant sage::NULL

source ·
pub const NULL: i64 = _; // -128i64
Expand description

The value of the NULL pointer constant.

+NULL in sage - Rust

Constant sage::NULL

source ·
pub const NULL: i64 = _; // -128i64
Expand description

The value of the NULL pointer constant.

I’ve chosen to use the smallest value that can be expressed by an 8-bit signed integer. This is because I want to make sure that this works with 8-bit machines as well. The value of this constant might change in the future though.

diff --git a/docs/sage/index.html b/docs/sage/index.html index 3680b058..e4a5073a 100644 --- a/docs/sage/index.html +++ b/docs/sage/index.html @@ -1,4 +1,4 @@ -sage - Rust

Crate sage

source ·
Expand description

The Sage Programming Language

+sage - Rust

Crate sage

source ·
Expand description

The Sage Programming Language

🚧 🏗️ ⚠️ This language is under construction! ⚠️ 🏗️ 🚧

  █████   ██████    ███████  ██████   `-.        _.-'
  ███░░   ░░░░░███  ███░░███ ███░░███   \ `,    .'/.'
@@ -10,8 +10,9 @@
                   ░░██████                           `--'
                    ░░░░░░            
 
+

Logo

-(The sage compiler itself can be compiled to web assembly to be executed on the web. This allows a sage compiler + interpreter to be hosted on a static web page and run embded sage scripts. This web implementation compiles sage LIR code into sage virtual machine code, and then feeds it to a builtin virtual machine interpreter. The compiler can also switch to various backends, such as the C source code generator, or assembly output.)

+(The sage compiler itself can be compiled to web assembly to be executed on the web. This allows a sage compiler + interpreter to be hosted on a static web page and run embedded sage scripts. This web implementation compiles sage LIR code into sage virtual machine code, and then feeds it to a builtin virtual machine interpreter. The compiler can also switch to various backends, such as the C source code generator, or assembly output.)

This crate implements a compiler for the sage programming language and its low level virtual machine.

What is Sage?

diff --git a/docs/sage/targets/index.html b/docs/sage/targets/index.html index 5de60dc3..d7bf745c 100644 --- a/docs/sage/targets/index.html +++ b/docs/sage/targets/index.html @@ -27,4 +27,4 @@

Future Structure

as ASCII/UNICODE with `PutChar. A hardware specific implementation may also choose to fail under unsupported targets to prevent use where not intended.

-

Re-exports

  • pub use c::*;
  • pub use my_os::*;
  • pub use x86::*;

Modules

Traits

\ No newline at end of file +

Re-exports

Modules

Traits

\ No newline at end of file diff --git a/docs/sage/targets/my_os/index.html b/docs/sage/targets/my_os/index.html deleted file mode 100644 index 21625372..00000000 --- a/docs/sage/targets/my_os/index.html +++ /dev/null @@ -1,15 +0,0 @@ -sage::targets::my_os - Rust

Module sage::targets::my_os

source ·
Expand description

C Target

-

An implementation of the virtual machine for the C language.

-

This allows the virtual machine to target C programs.

-

Portability

-

Right now, this target only supports GCC due to a quirk -with the way this implementation compiles functions. -For some reason, Clang doesn’t like nested functions, -even though the function’s addresses can still be known -as labels at compile time. I’m really not sure why Clang -chooses not to compile nested functions. This can be -fixed by this implementations by just moving function definitions -code outside of the main function, since the virtual machine -does not depend on defining functions at runtime.

-

Structs

  • The type for the C target which implements the Target trait. -This allows the compiler to target the C language.
\ No newline at end of file diff --git a/docs/sage/targets/my_os/sidebar-items.js b/docs/sage/targets/my_os/sidebar-items.js deleted file mode 100644 index c08b65eb..00000000 --- a/docs/sage/targets/my_os/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["MyOS"]}; \ No newline at end of file diff --git a/docs/sage/targets/my_os/struct.MyOS.html b/docs/sage/targets/my_os/struct.MyOS.html deleted file mode 100644 index a24cb590..00000000 --- a/docs/sage/targets/my_os/struct.MyOS.html +++ /dev/null @@ -1,27 +0,0 @@ -MyOS in sage::targets::my_os - Rust

Struct sage::targets::my_os::MyOS

source ·
pub struct MyOS;
Expand description

The type for the C target which implements the Target trait. -This allows the compiler to target the C language.

-

Trait Implementations§

source§

impl Architecture for MyOS

source§

fn supports_input(&self, i: &Input) -> bool

Whether or not the target architecture supports the given input (mode + channel).
source§

fn supports_output(&self, o: &Output) -> bool

Whether or not the target architecture supports the given output (mode + channel).
source§

fn op(&mut self, op: &CoreOp) -> String

Compile a CoreOp instruction.
source§

fn std_op(&mut self, op: &StandardOp) -> Result<String, String>

Compile a StandardOp instruction.
source§

fn end(&mut self, matching: &CoreOp, fun: Option<usize>) -> String

Compile an End instruction (with the matching If or While or Function)
source§

fn declare_proc(&mut self, label_id: usize) -> String

Compile the declaration of a procedure.
source§

fn name(&self) -> &str

The name of the target architecture.
source§

fn version(&self) -> &str

The version of the target architecture.
source§

fn supports_floats(&self) -> bool

Whether or not the target architecture supports floating point.
source§

fn get(&mut self, src: &Input) -> Result<String, String>

Get a value from the given input stream (mode + channel).
source§

fn put(&mut self, dst: &Output) -> Result<String, String>

Put a value to the given output stream (mode + channel).
source§

fn peek(&mut self) -> Result<String, String>

Peek a value from the device connected to the program.
source§

fn poke(&mut self) -> Result<String, String>

Poke a value to the device connected to the program.
source§

fn prelude(&self, _is_core: bool) -> Option<String>

The code before the program starts.
source§

fn post_funs(&self, funs: Vec<i32>) -> Option<String>

The code after the function definitions.
source§

fn postop(&self) -> Option<String>

The code after each instruction.
source§

fn postlude(&self, _is_core: bool) -> Option<String>

The code after the program ends.
source§

fn pre_funs(&self, _funs: Vec<i32>) -> Option<String>

The code before the function definitions.
source§

fn indentation(&self) -> Option<String>

The string used for indentation.
source§

impl CompiledTarget for MyOS

source§

fn build_op( - &mut self, - op: &CoreOp, - matching_ops: &mut Vec<CoreOp>, - matching_funs: &mut Vec<usize>, - current_fun: &mut usize, - indent: &mut usize -) -> Result<String, String>

source§

fn build_std_op( - &mut self, - std_op: &StandardOp, - matching_ops: &mut Vec<CoreOp>, - matching_funs: &mut Vec<usize>, - current_fun: &mut usize, - indent: &mut usize -) -> Result<String, String>

source§

fn build_core(&mut self, program: &CoreProgram) -> Result<String, String>

Compile the core variant of the machine code (must be implemented for every target).
source§

fn build_std(&mut self, program: &StandardProgram) -> Result<String, String>

Compile the standard variant of the machine code (should be implemented for every target possible).
source§

impl Default for MyOS

source§

fn default() -> MyOS

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for MyOS

§

impl Send for MyOS

§

impl Sync for MyOS

§

impl Unpin for MyOS

§

impl UnwindSafe for MyOS

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/sage/targets/sage_os/index.html b/docs/sage/targets/sage_os/index.html new file mode 100644 index 00000000..1ec0c546 --- /dev/null +++ b/docs/sage/targets/sage_os/index.html @@ -0,0 +1,15 @@ +sage::targets::sage_os - Rust

Module sage::targets::sage_os

source ·
Expand description

C Target

+

An implementation of the virtual machine for the C language.

+

This allows the virtual machine to target C programs.

+

Portability

+

Right now, this target only supports GCC due to a quirk +with the way this implementation compiles functions. +For some reason, Clang doesn’t like nested functions, +even though the function’s addresses can still be known +as labels at compile time. I’m really not sure why Clang +chooses not to compile nested functions. This can be +fixed by this implementations by just moving function definitions +code outside of the main function, since the virtual machine +does not depend on defining functions at runtime.

+

Structs

  • The type for the C target which implements the Target trait. +This allows the compiler to target the C language.
\ No newline at end of file diff --git a/docs/sage/targets/sage_os/sidebar-items.js b/docs/sage/targets/sage_os/sidebar-items.js new file mode 100644 index 00000000..7ed8cdae --- /dev/null +++ b/docs/sage/targets/sage_os/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["SageOS"]}; \ No newline at end of file diff --git a/docs/sage/targets/sage_os/struct.SageOS.html b/docs/sage/targets/sage_os/struct.SageOS.html new file mode 100644 index 00000000..f75d762f --- /dev/null +++ b/docs/sage/targets/sage_os/struct.SageOS.html @@ -0,0 +1,27 @@ +SageOS in sage::targets::sage_os - Rust

Struct sage::targets::sage_os::SageOS

source ·
pub struct SageOS;
Expand description

The type for the C target which implements the Target trait. +This allows the compiler to target the C language.

+

Trait Implementations§

source§

impl Architecture for SageOS

source§

fn supports_input(&self, i: &Input) -> bool

Whether or not the target architecture supports the given input (mode + channel).
source§

fn supports_output(&self, o: &Output) -> bool

Whether or not the target architecture supports the given output (mode + channel).
source§

fn op(&mut self, op: &CoreOp) -> String

Compile a CoreOp instruction.
source§

fn std_op(&mut self, op: &StandardOp) -> Result<String, String>

Compile a StandardOp instruction.
source§

fn end(&mut self, matching: &CoreOp, fun: Option<usize>) -> String

Compile an End instruction (with the matching If or While or Function)
source§

fn declare_proc(&mut self, label_id: usize) -> String

Compile the declaration of a procedure.
source§

fn name(&self) -> &str

The name of the target architecture.
source§

fn version(&self) -> &str

The version of the target architecture.
source§

fn supports_floats(&self) -> bool

Whether or not the target architecture supports floating point.
source§

fn get(&mut self, src: &Input) -> Result<String, String>

Get a value from the given input stream (mode + channel).
source§

fn put(&mut self, dst: &Output) -> Result<String, String>

Put a value to the given output stream (mode + channel).
source§

fn peek(&mut self) -> Result<String, String>

Peek a value from the device connected to the program.
source§

fn poke(&mut self) -> Result<String, String>

Poke a value to the device connected to the program.
source§

fn prelude(&self, _is_core: bool) -> Option<String>

The code before the program starts.
source§

fn post_funs(&self, funs: Vec<i32>) -> Option<String>

The code after the function definitions.
source§

fn postop(&self) -> Option<String>

The code after each instruction.
source§

fn postlude(&self, _is_core: bool) -> Option<String>

The code after the program ends.
source§

fn pre_funs(&self, _funs: Vec<i32>) -> Option<String>

The code before the function definitions.
source§

fn indentation(&self) -> Option<String>

The string used for indentation.
source§

impl CompiledTarget for SageOS

source§

fn build_op( + &mut self, + op: &CoreOp, + matching_ops: &mut Vec<CoreOp>, + matching_funs: &mut Vec<usize>, + current_fun: &mut usize, + indent: &mut usize +) -> Result<String, String>

source§

fn build_std_op( + &mut self, + std_op: &StandardOp, + matching_ops: &mut Vec<CoreOp>, + matching_funs: &mut Vec<usize>, + current_fun: &mut usize, + indent: &mut usize +) -> Result<String, String>

source§

fn build_core(&mut self, program: &CoreProgram) -> Result<String, String>

Compile the core variant of the machine code (must be implemented for every target).
source§

fn build_std(&mut self, program: &StandardProgram) -> Result<String, String>

Compile the standard variant of the machine code (should be implemented for every target possible).
source§

impl Default for SageOS

source§

fn default() -> SageOS

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/sage/targets/sidebar-items.js b/docs/sage/targets/sidebar-items.js index fba7f578..92302bb0 100644 --- a/docs/sage/targets/sidebar-items.js +++ b/docs/sage/targets/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"mod":["c","my_os","x86"],"trait":["Architecture","CompiledTarget"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"mod":["c","sage_os","x86"],"trait":["Architecture","CompiledTarget"]}; \ No newline at end of file diff --git a/docs/sage/targets/trait.Architecture.html b/docs/sage/targets/trait.Architecture.html index 64ba0d17..08d93cea 100644 --- a/docs/sage/targets/trait.Architecture.html +++ b/docs/sage/targets/trait.Architecture.html @@ -41,4 +41,4 @@
source

fn pre_funs(&self, _funs: Vec<i32>) -> Option<String>

The code before the function definitions.

source

fn post_funs(&self, _funs: Vec<i32>) -> Option<String>

The code after the function definitions.

source

fn indentation(&self) -> Option<String>

The string used for indentation.

-

Implementors§

\ No newline at end of file +

Implementors§

\ No newline at end of file diff --git a/docs/sage/targets/trait.CompiledTarget.html b/docs/sage/targets/trait.CompiledTarget.html index 3d79306b..15a14f6e 100644 --- a/docs/sage/targets/trait.CompiledTarget.html +++ b/docs/sage/targets/trait.CompiledTarget.html @@ -35,4 +35,4 @@ indent: &mut usize ) -> Result<String, String>
source

fn build_core(&mut self, program: &CoreProgram) -> Result<String, String>

Compile the core variant of the machine code (must be implemented for every target).

source

fn build_std(&mut self, program: &StandardProgram) -> Result<String, String>

Compile the standard variant of the machine code (should be implemented for every target possible).

-

Implementors§

source§

impl CompiledTarget for C

source§

impl CompiledTarget for MyOS

source§

impl CompiledTarget for X86

\ No newline at end of file +

Implementors§

\ No newline at end of file diff --git a/docs/search-index.js b/docs/search-index.js index f7390029..8b143916 100644 --- a/docs/search-index.js +++ b/docs/search-index.js @@ -1,5 +1,5 @@ var searchIndex = JSON.parse('{\ -"sage":{"doc":"The Sage Programming Language","t":"RRRAAAAAAACICCCCCCECCCCCCCCCNNNNNNLLLLLAKLLLLLKALKALKLAKLLLLLNNNNNNNNNNNNNNEDNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMDLLLLLLLLLLLLLLLLLLLLLRNRRRRRRRNNENRRLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNEDNNNNLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMFDNNDNNNENNNNNNENNNNNNDININDDDDDDNNSSNNNNEINNNENNNDNNSDNNENNDNNNNNNNNNDNEENDNNNDIINNNNNNNNNNNNNNNNNNNNNNNNNNSNNNNNNNNNNNNNNNENSDNNDNNNNNNDNNNDENNNNNDNNNNDENNNNNSINNNDNNNNNNNNNNNSDNNINNNNNENNNINNNSINNNNNNNNNNNNNNNLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMDLLLLLMLLMLLLLLMMMFFFFLLLLLAADLLLLLLLLLLLMLMLMLLLLLLNNNNENNNNNNNNNNDNNENNNNNNNNNNENNNNNNNNDENNNNNNNNNNNNNNDENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLIILLLLAKKKLAKKKKLLLLLKKKKKKADLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNDENDNNINNNNENNNNNNNNNNNNNNNNNNNNNNNNDDEDNNNDNNNINNLFFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLMKLLLMLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLMLLLLLLLLLLLLLLLKLLMLLLLLLLKLLLKLLLKLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["LOGO","LOGO_WITH_COLOR","NULL","asm","frontend","lir","parse","side_effects","targets","vm","A","AssemblyProgram","B","C","CoreOp","CoreProgram","D","E","Error","F","FP","GP","Globals","Location","REGISTERS","SP","StandardOp","StandardProgram","UndefinedGlobal","UndefinedLabel","Unexpected","Unmatched","UnsupportedInstruction","VirtualMachineError","borrow","borrow_mut","clone","clone_into","comment","core","current_instruction","eq","fmt","fmt","from","from","get_op","globals","into","is_defined","location","log_instructions_after","op","partial_cmp","std","std_op","to_owned","to_string","try_from","try_into","type_id","Add","And","Array","BitwiseAnd","BitwiseNand","BitwiseNor","BitwiseNot","BitwiseOr","BitwiseXor","Call","CallLabel","Comment","Compare","Copy","CoreOp","CoreProgram","Dec","Div","DivRem","Else","End","Fn","Get","GetAddress","Global","If","Inc","Index","IsEqual","IsGreater","IsGreaterEqual","IsLess","IsLessEqual","IsNotEqual","Many","Move","Mul","Neg","Next","Not","Or","Pop","PopFrom","Prev","Push","PushTo","Put","Rem","Return","Set","SetLabel","Sub","Swap","While","assemble","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","cmp","cmp","code","current_instruction","default","eq","eq","equivalent","equivalent","fmt","fmt","fmt","fmt","from","from","get_op","hash","hash","into","into","is_defined","new","op","partial_cmp","partial_cmp","push_string","put_string","stack_alloc_string","std_op","to_owned","to_owned","to_string","to_string","try_from","try_from","try_into","try_into","type_id","type_id","a","a","a","a","a","a","a","addr","b","b","b","b","b","b","b","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","name","offset","size","size","size","size","sp","sp","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","vals","Globals","add_global","borrow","borrow_mut","clone","clone_into","default","fmt","fmt","from","get_global","get_global_location","get_global_size","get_size","into","new","resolve","to_owned","to_string","try_from","try_into","type_id","A","Address","B","C","D","E","F","FP","GP","Global","Indirect","Location","Offset","REGISTERS","SP","borrow","borrow_mut","clone","clone_into","cmp","deref","eq","equivalent","fmt","fmt","from","hash","into","offset","partial_cmp","to_owned","to_string","try_from","try_into","type_id","ACos","ASin","ATan","Add","Alloc","Call","CoreOp","Cos","Div","Free","IsGreater","IsLess","Mul","Neg","Pow","Rem","Set","Sin","Sqrt","StandardOp","StandardProgram","Sub","Tan","ToFloat","ToInt","assemble","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","code","current_instruction","default","eq","eq","fmt","fmt","fmt","fmt","from","from","from","get_op","into","into","is_defined","new","op","partial_cmp","partial_cmp","std_op","to_owned","to_owned","to_string","to_string","try_from","try_from","try_into","try_into","type_id","type_id","a","a","b","b","dst","dst","dst","dst","dst","dst","dst","dst","src","src","src","src","src","src","parse","Add","Add","Alt","And","Annotated","Annotated","Annotated","Annotation","Any","Any","Apply","Apply","ApplyNonProc","ApplyNonTemplate","Arithmetic","Array","Array","Array","As","As","AssemblyError","Assign","AssignOp","AssignOp","BinaryOp","BinaryOp","BitwiseAnd","BitwiseNand","BitwiseNor","BitwiseNot","BitwiseOr","BitwiseXor","Bool","Bool","COMPILER_GENERATED","CONSTANT","Cell","Cell","Char","Char","Comparison","Compile","CompilePolyProc","CompilerGenerated","Const","ConstExpr","ConstExpr","ConstExpr","Constant","CoreBuiltin","CoreBuiltin","CouldntSimplify","DEAD_CODE","Data","DeadCode","Debug","Declaration","Declare","Declare","Delete","Deref","DerefMut","DerefNonPointer","Display","Divide","Enum","EnumUnion","EnumUnion","EnumUnion","Env","Equal","Error","Expr","ExternProc","FFIProcedure","FFIProcedure","Float","Float","Get","GetSize","GetType","GreaterThan","GreaterThanOrEqual","If","IfLet","Immutable","Impl","Index","Int","Int","InvalidAs","InvalidAssignOp","InvalidAssignOpTypes","InvalidBinaryOp","InvalidBinaryOpTypes","InvalidConstExpr","InvalidIndex","InvalidMatchExpr","InvalidMonomorphize","InvalidPatternForExpr","InvalidPatternForType","InvalidRefer","InvalidTemplateArgs","InvalidTernaryOp","InvalidTernaryOpTypes","InvalidUnaryOp","InvalidUnaryOpTypes","LIVE_CODE","LessThan","LessThanOrEqual","Let","Location","Many","Many","Many","Match","Member","Member","MemberNotFound","MismatchedMutability","MismatchedTypes","Monomorphize","Multiply","Mutability","Mutable","NONE","Negate","NegativeArrayLength","Never","New","NonExhaustivePatterns","NonIntegralConst","NonSymbol","None","None","None","Not","NotEqual","Null","Of","Or","Pattern","Pointer","Pointer","Poly","PolyProc","PolyProc","PolyProcedure","Power","Proc","Proc","Proc","Procedure","Put","RecursionDepthConst","RecursionDepthTypeEquality","Refer","Remainder","Return","SIMPLIFY_RECURSION_LIMIT","Simplify","SizeOfExpr","SizeOfTemplate","SizeOfType","StandardBuiltin","StandardBuiltin","StaticVar","Struct","Struct","Struct","Struct","Subtract","Symbol","Symbol","Symbol","SymbolNotDefined","TEMPORARY","Tag","Template","Temporary","TernaryOp","TernaryOp","Tuple","Tuple","Tuple","Tuple","Type","Type","Type","Type","TypeCheck","TypeNotDefined","TypeOf","TypeRedefined","USER_GENERATED","UnaryOp","UnaryOp","Union","Union","Union","Unit","UnsizedType","UnsupportedOperation","UnusedExpr","Var","VarPat","Variant","VariantNotFound","When","While","Wildcard","add","add","add_assign","add_associated_const","add_monomorphized_associated_consts","alt","and","annotate","annotate","annotate","app","app","apply","are_patterns_exhaustive","args","args","as_bool","as_float","as_int","as_symbol","as_type","as_type","assign","assign_op","bitand","bitnand","bitnor","bitnot","bitor","bitor","bitor_assign","bitxor","body","body","bool","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_cast_to","can_decay_to","can_decay_to","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile_expr","compile_expr","compile_expr","compile_expr","compile_expr","compile_expr","compile_expr","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","contains_symbol","debug","declare_let_bind","default","default","define_types","define_var","deref","deref_mut","display","display","display","display","display","display","display","display","display","div","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","equals","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","field","field","float","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_mono","ge","get_all_associated_consts","get_args","get_associated_const","get_bindings","get_body","get_branch_result_type","get_common_name","get_mangled_name","get_method_call_mutability","get_monomorph_template_args","get_name","get_ret","get_self_param_mutability","get_size","get_size","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_template_params","get_type","get_type","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_of_associated_const","gt","has_associated_const","has_element_type","has_location","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","idx","if_let_pattern","if_then","int","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","is_atomic","is_compiler_generated","is_concrete","is_constant","is_dead_code","is_exhaustive","is_location","is_method_call","is_monomorph_of","is_mutable","is_none","is_poly","is_recursive","is_recursive_helper","is_self_param_reference","is_simple","is_temporary","le","let_bind","let_const","let_consts","let_proc","let_procs","let_type","let_types","let_var","let_vars","location","lt","match_pattern","monomorphize","monomorphize","mul","name","name","neg","neq","new","new","new","new","not","or","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","perform_template_applications","pointer","pow","proc","push_label","refer","rem","ret","ret","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","set_common_name","simplify","simplify_checked","simplify_checked","simplify_checked","simplify_until_atomic","simplify_until_concrete","simplify_until_has_members","simplify_until_has_variants","simplify_until_matches","simplify_until_poly","simplify_until_simple","simplify_until_type_checks","simplify_until_union","size_of","strip_template","struct_","structure","sub","substitute","substitute","substitute","substitute","substitute","substitute","substitute","substitute","substitute","substitute_types","substitute_types","sym","template","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","transform_method_call","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tup","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unop","var","variant_index","while_loop","wildcard","with","with","expected","expected","expr","expr","expr","found","found","patterns","SourceCodeLocation","borrow","borrow_mut","clone","clone_into","cmp","column","eq","equivalent","filename","fmt","from","get_code","hash","into","length","line","offset","parse_asm","parse_frontend","parse_lir","parse_vm","partial_cmp","to_owned","try_from","try_into","type_id","ffi","io","FFIBinding","borrow","borrow_mut","clone","clone_into","cmp","eq","equivalent","fmt","fmt","from","hash","input_cells","into","name","new","output_cells","partial_cmp","to_owned","to_string","try_from","try_into","type_id","Accelerometer","Altimeter","AnalogPin","AnalogPin","Axis","Barometer","Bell","Black","Blower","Blue","BlueLight","Brightness","Brightness","Button","Buzzer","Channel","ClearDisplay","Clock","Color","Compass","ConductivitySensor","Cooler","Custom","Custom","Cyan","DPad","DepthSensor","DigitalPin","DigitalPin","Direction","Down","Fan","FlowSensor","Green","GreenLight","Gyroscope","Heater","Humidity","Input","InputMode","JoyStick","Keyboard","Left","Magenta","Magnetometer","Microphone","MotorSpeed","MoveCursorDown","MoveCursorLeft","MoveCursorRight","MoveCursorUp","Note","Odometer","Orange","Output","OutputMode","PHSensor","Position","Pressure","PressureGauge","PrinterChar","PrinterFloat","PrinterInt","Proximity","Pump","RGB","RainGauge","Random","Red","RedLight","Right","Servo","SetCursorChar","SetCursorColumn","SetCursorPixel","SetCursorRow","Solenoid","SpeakerFrequency","SpeakerVolume","Speedometer","StderrChar","StderrFloat","StderrInt","StdinChar","StdinFloat","StdinInt","StdoutChar","StdoutFloat","StdoutInt","StepperMotor","Temperature","Thermometer","UVSensor","Up","UpdateDisplay","Valve","VolumeSensor","WeightSensor","White","WindDirection","WindSpeed","X","Y","Yellow","Z","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","channel","channel","clock","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","hash","hash","hash","hash","hash","hash","hash","hash","into","into","into","into","into","into","into","into","mode","mode","new","new","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","random","stderr_char","stderr_float","stderr_int","stdin_char","stdin_float","stdin_int","stdout_char","stdout_float","stdout_int","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","Architecture","CompiledTarget","build_core","build_op","build_std","build_std_op","c","declare_proc","end","get","indentation","my_os","name","op","peek","poke","post_funs","postlude","postop","pre_funs","prelude","put","std_op","supports_floats","supports_input","supports_output","version","x86","C","borrow","borrow_mut","declare_proc","default","end","from","get","into","name","op","peek","poke","post_funs","postlude","postop","prelude","put","std_op","supports_floats","supports_input","supports_output","try_from","try_into","type_id","version","MyOS","borrow","borrow_mut","declare_proc","default","end","from","get","into","name","op","peek","poke","post_funs","postlude","postop","prelude","put","std_op","supports_floats","supports_input","supports_output","try_from","try_into","type_id","version","X86","borrow","borrow_mut","declare_proc","default","end","from","get","into","name","op","peek","poke","post_funs","postlude","postop","prelude","put","std_op","supports_floats","supports_input","supports_output","try_from","try_into","type_id","version","ACos","ASin","ATan","Add","Add","Alloc","BitwiseNand","Call","Call","Comment","CoreInterpreter","CoreOp","CoreOp","CoreProgram","Cos","Deref","Device","Div","Div","Else","End","Error","ExpectedCore","Free","Function","Get","If","Index","IsNonNegative","IsNonNegative","Move","Mul","Mul","Peek","Poke","Pow","Put","Refer","Rem","Rem","Restore","Return","Save","Set","Set","Sin","StandardDevice","StandardInterpreter","StandardOp","StandardProgram","Sub","Sub","Tan","TestingDevice","ToFloat","ToInt","UnsupportedInstruction","VirtualMachineProgram","Where","While","add_binding","as_float","as_int","begin_else","begin_function","begin_if","begin_while","bitwise_nand","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","code","code","code","comment","default","default","default","default","default","default","deref","end","eq","eq","eq","eq","eq","equivalent","equivalent","ffi","ffi_call","ffi_call","ffi_call","ffi_call","ffi_channel","flatten","flatten","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","get","get","get","get","get_functions","get_functions","get_main","get_main","get_main_and_functions","get_main_and_functions","hash","hash","index","input","into","into","into","into","into","into","into","into","into","is_non_negative","move_pointer","new","new","new","new_raw","op","op","op","output","output_str","output_vals","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","peek","peek","peek","peek","poke","poke","poke","poke","put","put","put","put","refer","restore","ret","run","run","save","set_register","std_op","std_op","std_op","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","where_is_pointer"],"q":[[0,"sage"],[10,"sage::asm"],[61,"sage::asm::core"],[163,"sage::asm::core::CoreOp"],[231,"sage::asm::globals"],[253,"sage::asm::location"],[288,"sage::asm::std"],[353,"sage::asm::std::StandardOp"],[371,"sage::frontend"],[372,"sage::lir"],[1551,"sage::lir::Error"],[1559,"sage::parse"],[1586,"sage::side_effects"],[1588,"sage::side_effects::ffi"],[1611,"sage::side_effects::io"],[1877,"sage::targets"],[1905,"sage::targets::c"],[1931,"sage::targets::my_os"],[1957,"sage::targets::x86"],[1983,"sage::vm"]],"d":["The UNICODE character art for the logo of the language.","The UNICODE character art for the logo of the language, …","The value of the NULL pointer constant.","Assembly Module","","LIR (Low Intermediate Representation) Module","Parsing Module","","Targets Module","Virtual Machine Module","","A frontend to both the CoreProgram and StandardProgram …","","","","","","","An error generated by assembling some assembly language …","","","","","","","","","","The given global was not defined.","The given label was not defined.","The given instruction was not expected, or cannot be used …","The given instruction did not have a matching “end”. …","Is this standard assembly operation supported by the …","An error generated by the virtual machine.","","","","","Insert a comment into the program.","Core Assembly Variant","Get the current instruction number.","","","","","Returns the argument unchanged.","Get the operation at the given instruction number.","","Calls U::from(self).","Is the given label defined yet in the operations? I.E., …","Assembly Memory Location","Log all the instructions after the given instruction …","Insert a core operation into the program.","","Standard Assembly Variant","Attempt to insert a standard operation into the program. …","","","","","","Add an integer value from a source location to a …","Logical “and” a destination with a source value.","Store a list of values at a source location. Then, store …","","","","","","","Get a value in memory and call it as a label ID.","Call a function with a given label.","","Store the comparison of “a” and “b” in a …","Copy a number of cells from a source referenced location …","A core instruction of the assembly language. These are …","An assembly program composed of core instructions, which …","Decrement the integer value of a location.","Divide a destination location by a source value.","Divide a destination location by a source value. Store the …","Add an “else” clause to an “if the value is not zero…","Terminate a function declaration, a while loop, an if …","Declare a new label.","Get a value from the input device / interface and store it …","Get the address of a location, and store it in a …","Declare a global variable.","Begin an “if the value is not zero” statement over a …","Increment the integer value of a location.","Get the address of a location indexed by an offset stored …","Perform dst = a == b.","Perform dst = a > b.","Perform dst = a >= b.","Perform dst = a < b.","Perform dst = a <= b.","Perform dst = a != b.","Many instructions to execute; conveniently grouped …","Copy a value from a source location to a destination …","Multiply a destination location by a source value.","Negate an integer.","Make this pointer point to the next cell (or the nth next …","Replace a value in memory with its boolean complement.","Logical “or” a destination with a source value.","Pop a number of cells from the stack and store it in a …","Pop a number of cells from a specified stack and store it …","Make this pointer point to the previous cell (or the nth …","Push a number of cells starting at a memory location on …","Push a number of cells starting at a memory location onto …","Put a value from a source register to the output device / …","Store the remainder of the destination modulus the source …","Return from the current function.","Set the value of a register, or any location in memory, to …","Set the value of a register, or any location in memory, to …","Subtract a source integer value from a destination …","Swap the values of two locations.","Begin a “while the value is not zero” loop over a …","Assemble a program of core assembly instructions into the …","","","","","","","","","","","The list of core assembly instructions in the program.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","","Create a new program of core assembly instructions.","","","","Push a string literal as UTF-8 to the stack.","Put a string literal as UTF-8 to the output device.","Allocate a string on the stack, and store its address in a …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A lookup for all the global variables in an assembly …","Add a global variable to the list of globals.","","","","","Create a new empty Globals lookup.","","","Returns the argument unchanged.","Get the location, and size of a global variable.","Get the location of a global variable.","Get the size of a global variable. This is the number of …","Get the size of the global variables. This is the number …","Calls U::from(self).","Create a new empty Globals lookup.","Resolve the global variables in a location to produce an …","","","","","","The “A” general purpose register.","A fixed position in the tape (a constant address known at …","The “B” general purpose register.","The “C” general purpose register.","The “D” general purpose register.","The “E” general purpose register.","The “F” general purpose register.","The frame pointer register.","The Global Pointer register. This is used to access global …","A global variable.","Use the value of a cell on the tape as an address. For …","A location in memory (on the tape of the virtual machine).","Go to a position in memory, and then move the pointer …","","The stack pointer register.","","","","","","Get the location of the value pointed to by this location.","","","","","Returns the argument unchanged.","","Calls U::from(self).","Get the location offset by a constant number of cells from …","","","","","","","Perform inverse Cos on a cell (float) and store the result …","Perform inverse Sin on a cell (float) and store the result …","Perform inverse Tan on a cell (float) and store the result …","Add the source cell (float) to the destination cell …","Take the value in the operand cell. Allocate that number …","Call a foreign function.","Execute a core instruction.","Perform Cos on a cell (float) and store the result in the …","Divide the destination cell (float) by the source cell …","Free the memory allocated at the address stored in the …","Perform dst = a > b.","Perform dst = a < b.","Multiply the source cell (float) by the destination cell …","Negate the value of a cell (float) and store the result in …","Raise a cell (float) to the power of another cell (float).","Perform the modulo operation on the destination cell …","Set the value of a cell to a constant float.","Perform Sin on a cell (float) and store the result in the …","Take the square root of a cell (float).","A standard instruction of the assembly language. These are …","A program composed of standard instructions, which can be …","Subtract the source cell (float) from the destination cell …","Perform Tan on a cell (float) and store the result in the …","Take the integer value stored in a cell and store the …","Take the float value stored in a cell and store the …","Assemble the program into a virtual machine program.","","","","","","","","","The list of standard assembly instructions in the program.","Get the current instruction number.","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Get the operation at the given instruction number.","Calls U::from(self).","Calls U::from(self).","Is the given label defined yet in the operations?","Create a new program of core assembly instructions.","Add a core operation to the program.","","","Add a standard operation to the program.","","","","","","","","","","","The first cell in the comparison (left hand side).","The first cell in the comparison (left hand side).","The second cell in the comparison (right hand side).","The second cell in the comparison (right hand side).","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The source cell.","The source cell.","The source cell.","The source cell.","The source cell.","The source cell.","","","","","A boolean “And” operation between two values.","An error with some annotation about the source code that …","","An expression along with data about its source code …","An annotation for metadata about an LIR expression. This …","Unchecked access to a value. This is used to override …","A type reserved by the compiler. This type is equal to any …","Apply a function with some arguments.","A type that constructs a concrete type from a polymorphic …","Tried to apply a non-procedure to some arguments.","Tried to apply a non-template type to some arguments.","An arithmetic operation.","An array of constant values.","An array of expressions.","An array of a given type, with a constant size.","Cast a constant expression to another type.","Cast an expression to another type.","An error caused by trying to assemble invalid code …","An assignment operation. This is used to implement …","A trait used to implemented an assignment operation.","Perform an assignment operation on two expressions.","A trait used to implement a binary operation.","Perform a binary operation on two expressions.","A boolean “BitwiseAnd” operation between two values.","A boolean “BitwiseNand” operation between two values.","A boolean “BitwiseNor” operation between two values.","","A boolean “BitwiseOr” operation between two values.","A boolean “BitwiseXor” operation between two values.","A constant boolean value.","The type of a boolean value.","An annotation for compiler-generated code.","An annotation for a constant.","A constant integer value representing a cell on the tape.","The type of the most basic unit of memory.","A constant chararacter.","The type of a character.","A comparison operation between two values.","A trait which allows an LIR expression to be compiled to …","Tried to compile a polymorphic procedure without …","Is this expression compiler-generated?","A constant expression.","A compiletime expression.","A constant expression.","","Is this expression a constant?","A builtin pseudo-procedure implemented in the core …","A builtin implemented in handwritten core assembly.","Recursion depth exceeded when trying to confirm a type’s …","An annotation for dead code.","Get the Union data associated with a tagged union …","Is this expression dead code?","","A declaration of a variable, function, type, etc.","Bind a list of types in a constant expression.","Declare any number of variables, procedures, types, or …","","Dereference this expression (i.e. get the value it points …","Store an expression to an address (a pointer).","Tried to dereference a non-pointer.","","","An enumeration of a list of possible named values. A …","A tagged union of constant values.","A tagged union: a typechecked union of different variants. …","An enumeration of a list of possible types. This is a sum …","An environment under which expressions and types are …","","An LIR compilation error.","TODO: Add variants for LetProc, LetVar, etc. to support …","A foreign function declaration.","A typed procedure which calls a foreign function. This is …","A foreign function interface binding.","A constant floating point value.","The floating-point number type.","","Get the size of something in memory (number of cells).","Get the type associated with a value under a given …","","","An if-then-else expression.","An if-let expression.","Immutable access to a value. This is the default way to …","Declare associated constants and procedures for a type.","Index an array or pointer with an expression that …","A constant integer value.","The integer type.","Invalid type casting expression.","Invalid assignment operation (assign, add_assign, …","Invalid assign op types (incorrect types).","Invalid binary operation (add, subtract, and, or) …","Invalid binary op types (incorrect types).","Invalid constant expression.","Invalid Index expression (incorrect types).","Tried to match over an expression that cannot be matched …","Cannot monomorphize a constant expression.","Tried to use a pattern that is not valid for the given …","Tried to use a pattern that is not valid for the given …","Invalid Refer expression. The compiler was not able to …","Invalid number of template arguments to a type.","Invalid ternary operation (if) expression (incorrect …","Invalid ternary op types (incorrect types).","Invalid unary operation (negate, not) expression …","Invalid unary op types (incorrect types).","An annotation for live code.","","","Bind a type to a name in a temporary scope.","The source code location of the expression.","Many annotations can be attached to an expression. This is …","Many declarations.","A block of expressions. The last expression in the block …","A match expression.","Get an attribute of a constant expression.","Get a field or member from a structure, union, or tuple. …","Tried to access an undefined member of a tuple, struct, or …","Mismatched mutability","Mismatched types","Monomorphize a constant expression with some type …","","Mutability of a pointer. This is used to provide type …","Mutable access to a value.","A constant expression that evaluates to None. This …","","Tried to create an array with a negative length.","The type of an expression that will never return, or doesn…","","Invalid pattern for a match expression.","Got another type when expecting an integer, bool, or char.","Expected a symbol, but got something else.","No annotation.","The unit, or “void” instance.","The type of void expressions.","A boolean “Not” operation on a value.","","The null pointer constant.","A constant enum variant.","A boolean “Or” operation between two values.","A pattern which can be matched against an expression.","","A pointer to another type.","A polymorphic, parametric type. This type is used with the …","A polymorphic procedure.","A polymorphic procedure declaration.","A polymorphic procedure of LIR code which can be applied …","","A procedure.","A procedure declaration.","A procedure with a list of parameters and a return type.","A monomorphic procedure of LIR code which can be applied …","Print a value to a given output.","Recursion depth exceeded when trying to evaluate a …","Recursion depth exceeded when trying to confirm a type’s …","Reference this expression (i.e. get a pointer to it).","","Return a value from a function.","This is the maximum number of times a type will be …","Simplify an expression while maintaining structural …","Get the size of an expression’s type (in cells) as a …","Tried to get the size of a template type.","Get the size of a type (in cells) as a constant int.","A builtin pseudo-procedure implemented in the standard …","A builtin implemented in handwritten standard assembly.","A static variable declaration.","A structure of constant values.","A structure of fields to expressions.","","A tuple with named members. This is a product type.","","A named constant.","","A named type.","A symbol was used, but not defined.","An annotation for a temporary.","Get the Enum value of the tag associated with a tagged …","","Is this expression a temporary?","A trait used to implement a ternary operation.","Perform a ternary operation on three expressions.","A tuple of constant values.","A tuple of expressions.","","A heterogenous collection of types. This is a product type.","The representation of a type in the LIR type system.","A type as a constant expression.","A type declaration.","A trait object. This is internally represented as an …","A trait used to enforce type checking.","A type was used, but not defined.","Get the type of an expression. (as an array of chars)","Tried to define a type that already exists.","An annotation for user-generated code.","A trait used to implement a unary operation.","Perform a unary operation on two expressions.","A union of constant values.","A union: a collection of named fields. The Type value is …","A union of a list of possible types mapped to named …","This type is identified by its name. Most types are …","Tried to instantiate a type that cannot be sized. This is …","Expression uses an operation unsupported by the target.","Unused expression returned a non-None value.","A variable declaration.","A variable declaration with a pattern.","","The variant of an enum is not defined.","A constant, compile time if-then-else expression.","Create a while loop: while the first expression evaluates …","","","Add this expression to another.","","","","Construct a new pattern which binds to several alternate …","Logical and this expression with another.","Annotate an error with some metadata.","Annotate this constant expression with a source code …","An annotated expression with some metadata.","Apply this procedure or builtin to a list of expressions …","Apply this expression as a procedure to some arguments.","","This associated function returns whether or not a set of …","The arguments of the builtin. These will be typechecked …","The arguments of the builtin. These will be typechecked …","Try to get this constant expression as a boolean value.","Try to get this constant expression as a float.","Try to get this constant expression as an integer.","Try to get this constant expression as a symbol (like in …","Cast an expression as another type.","Cast an expression as another type.","Perform an AssignOp on this expression.","Perform an AssignOp on this expression.","BitwiseAnd this expression with another.","BitwiseOr this expression with another.","BitwiseAnd this expression with another.","BitwiseAnd this expression with another.","","BitwiseOr this expression with another.","","Bitwise this expression with another.","The list of assembly instructions to be pasted into the …","The list of assembly instructions to be pasted into the …","Construct a new pattern which matches a constant boolean.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Checks if the operation can be applied to the given types.","Checks if the operation can be applied to the given type.","Checks if the operation can be applied to the given types.","Checks if the operation can be applied to the given types.","","","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Can this type be cast to another type?","Can a pointer of this mutability decay to a pointer of …","Can this type decay into another type?","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Clones the operation into a boxed trait object.","Clones the operation into a boxed trait object.","Clones the operation into a boxed trait object.","Clones the operation into a boxed trait object.","","","","Clone this operation into a trait object.","Clone this binary operation into a box.","Clone this binary operation into a box.","Clone this binary operation into a box.","","Clone this binary operation into a box.","Clone this binary operation into a box.","","Clone this operation into a box.","Clone this operation into a box.","Clone this binary operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Compile the expression into an assembly program.","Compile the expression into an assembly program.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expression.","Compiles the operation on the given expression.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compile the assignment operation.","","","","","","","","Compiles the operation on the given types. (Generates the …","Compiles the operation on the given type. (Generates the …","Compiles the operation on the given types. (Generates the …","Compiles the operation on the given types. (Generates the …","","","Compile the binary operation.","Compile the assignment operation.","Compile the binary operation.","Compile the binary operation.","Compile the binary operation.","","Compile the binary operation.","Compile the binary operation.","Compile the binary operation.","Compile the unary operation.","Compile the unary operation.","Compile the binary operation.","Compile the binary operation.","Compile the unary operation.","Compile the unary operation.","Compile the unary operation.","Compile the unary operation.","Compile the unary operation.","Does this type contain a symbol with the given name? This …","","Let-bind the pattern to the given expression. This will …","","","Define multiple types with the given names under this …","Define a variable in the current scope. This will …","Dereference this expression (i.e. get the value it points …","Dereference this expression (i.e. get the value it points …","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","","Divide this expression by another.","","","","","","","","","Is this expression greater than another?","","","","","","","","","","","","","","","","","","","","","","","","","Are two types structurally equal?","","","","","","","","","","","","","","","","","","","","","","","","","","","Evaluates the operation on the given constant expressions.","Evaluates the operation on the given constant expression.","Evaluates the operation on the given constant expressions.","Evaluates the operation on the given constant expressions.","Evaluate this constant expression at compile time, and get …","","","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Get a field from a structure, union, or tuple.","Get a field from a structure, union, or tuple.","Construct a new pattern which matches a constant float.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Returns the argument unchanged.","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Is this expression greater than or equal to another?","","Get the arguments of the procedure.","","Get the map of new variables and their types which are …","Get the body of the procedure.","Get the type of a branch with a given expression matched …","Get the name of the procedure known to the LIR front-end.","Get the mangled name of the procedure. The procedure’s …","","","Get the name of this polymorphic procedure. This is not …","Get the return type of the procedure.","Get the first argument’s mutability (if it is a pointer)","Get the size of something in memory (number of cells).","Get the size of something in memory (number of cells).","Get the size of something in memory, but limit the number …","","","","","","","","","","Get the type associated with a value under a given …","Get the type associated with a value under a given …","Get the type of a value under a given environment and check","","","","","","","","Get the type of an associated constant of a type.","Is this expression greater than another?","","Does this type have an element type matching the supplied …","Does this annotation have a location?","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Index an array or pointer with an expression that …","Generate an if letexpression, which matches a given expr, …","Create an if-then-else statement with this expression as …","Construct a new pattern which matches a constant integer.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Is this type an irreducible, atomic type?","Is this compiler-generated?","","Is this data protected against mutation?","Is this dead code?","Is this pattern exhaustive?","Is this annotation a location?","","","Can this data be accessed mutably?","Is this annotation none?","","","","Is first argument of function a reference?","Is this type in a simple form? A simple form is a form …","Is this a temporary?","Is this expression less than or equal to another?","Create a let-bound type.","Create a let binding for a constant expression.","Create several const bindings at onces.","Create a proc binding for a procedure.","Create several proc bindings at onces.","Create a let binding for an type.","Create several type bindings at onces.","Create a let binding for an expression.","Create a let binding for an expression, and define …","Get the location of this annotation.","Is this expression less than another?","Generate an expression which evaluates a match expression, …","","Take some type arguments and produce a monomorphized …","Multiply this expression by another.","The name of the builtin. This isn’t used in compilation, …","The name of the builtin. This isn’t used in compilation, …","Get the remainder of this expression divided by another.","Is this expression greater than or equal to another?","Create a new assignment operation.","Create a new FFI procedure.","Construct a new procedure with a given list of arguments …","Construct a new polymorphic procedure with type …","Logical not this expression.","Logical or this expression with another.","","","","","","","","","","","","","","","","","","","","","","","Perform type applications if possible.","Construct a new pattern which matches a pointer.","Get the power of this expression to another.","Construct a procedure.","Push this procedure’s label to the stack.","Reference this expression (i.e. get a pointer to it).","Get the remainder of this expression divided by another.","The return value the builtin will leave on the stack after …","The return value the builtin will leave on the stack after …","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expression.","Gets the type of the operation on the given expression.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","","","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","This is just for debugging purposes. This sets the common …","Simplify an expression while maintaining structural …","Simplify an expression while maintaining structural …","","","","Simplify until the type is concrete.","Simplify a type until you can get its members.","Simplify a type until you can get its variants.","Simplify an expression until it matches a given function …","Simplify until the type is a polymorphic type.","","Simplify until the type passes the type checker.","Simplify a type until it’s a union.","Get the size of an expression.","","Construct a new pattern which matches a struct with a …","Create a structure of fields to expressions.","Subtract an expression from this expression.","Substitute a type for a given name in the environment.","","Substitute a type in a given expression.","","","","","","Substitute all occurences of a symbol with another type. …","","","Construct a new pattern which matches a symbol with a …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Construct a new pattern which matches a tuple of patterns.","Type check the expression.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expression.","Typechecks the operation on the given expression.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","","","","Type-check a pattern match of an expression against this …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Apply a unary operation to this expression.","Evaluate a variable in the current scope.","Calculate the integral value of a variant in an enum.","Create a while statement with this expression as the …","Construct a new pattern which matches any expression.","Return this expression, but with a given declaration in …","Return this expression, but with a given declaration in …","","","","","","","","","A struct representing a location in the source code. This …","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","Parse Core and Standard variants of assembly source code. …","Parse frontend sage code into an LIR expression.","Parse LIR code as an LIR expression.","Parse Core and Standard variants of virtual machine source …","","","","","","","","This is an FFI binding, which is used to call a foreign …","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","Create a new FFI binding.","","","","","","","","Input from an accelerometer (in meters per second per …","Input from altitude sensor (in meters)","Electrical device input modes (These should typically be …","Electrical device output modes Set the voltage of a given …","The different axes an input or output might use.","Input from a barometer (pressure in atmospheres)","Ring a bell (in hertz)","Black","Set the pressure of a given blower (in atmospheres)","Blue","Blue light intensity (in lux)","Input from a light sensor (in lux)","Lighting device output modes Set the brightness of a given …","Input from a button (0=not pressed, 1=pressed)","Sound output modes Ring a given buzzer (in hertz)","The channel to use for a given I/O mode.","Clear the display","Physical sensor input modes (These should typically be …","The different output colors a program might use.","Input from a compass (degrees)","Input from a conductivity sensor (in siemens per meter)","Turn a cooler on or off (0=off, 1=on)","Custom output modes A custom input mode (for use with a …","Custom output modes A custom output mode (for use with a …","Cyan","User input modes (These should typically be used for games …","Input from depth sensor (in meters)","Input from a digital input (0=low, 1=high)","Set the state of a given digital output (0=low, 1=high)","The different directions a D-Pad a might use.","","Set the pressure of a given fan (in atmospheres)","Input from a flow sensor (in liters per second)","Green","Green light intensity (in lux)","Input from a gyroscope (in degrees per second) around a …","Turn a heater on or off (0=off, 1=on)","Input from a humidity sensor (in percent)","An input source for a program.","The different types of input modes a program might use.","Input from a JoyStick the degree of displacement in a …","Input from keyboard (ASCII character)","","Magenta","Input from a magnetometer (in teslas) in a given axis","Input from a microphone (frequency in hertz)","Set the speed of a given motor (in revolutions per minute)","Move the cursor down on the display","Move the cursor left on the display","Move the cursor right on the display","Move the cursor up on the display","Play a given note (in hertz)","Input from an odometer (in meters)","Orange","An output destination for a program.","The different types of output modes a program might use.","Input from a pH sensor (in pH)","Input from a position sensor in a given axis (x, y, z)","Set the pressure of a given vacuum/pressurizer …","Engineering / Science sensor input modes Input from a …","Alternative output modes for standard output Printer …","Printer (float)","Printer (integer)","Input from a distance sensor (in meters)","Set the pressure of a given pump (in atmospheres)","RGB ","Input from a rain gauge (in millimeters)","Special input modes A random number","Red","Environment sensor input modes (These should typically be …","","Set the position of a given servo (in radians)","Write a character to the display","Set the cursor column on the display","Set the color of a given pixel on the display","Set the cursor row on the display","Set the polarity of a solenoid (0=off, 1=on)","Set the frequency of a given speaker (in hertz)","Set the volume of a given speaker (in percent)","Navigation input modes (These should typically be …","Standard error (ASCII character)","Standard error (float)","Standard error (integer)","Standard input modes (The standard interface is typically …","Standard input (float)","Standard input (integer)","Standard output modes Standard output (ASCII character)","Standard output (float)","Standard output (integer)","Robotics device output modes Set the position of a given …","Set the temperature of a given heating/cooling device …","Input from a thermometer (degrees K)","Input from a UV sensor (in watts per square meter)","","Display output modes Update the display","Set the position of a given valve (0=closed, 1=open)","Input from a volume sensor (in liters)","Input from a weight sensor (in kilograms)","White","Input from a wind direction sensor (in degrees)","Input from a wind speed sensor (in meters per second)","","","Yellow","","","","","","","","","","","","","","","","","","The channel to use for the input.","The channel to use for the output.","The time (in seconds) since the program started","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","The mode of the input.","The mode of the output.","Create a new input source.","Create a new output destination.","","","","","","","","","A random number","Output to STDERR (ASCII character)","Output to STDERR (float)","Output to STDERR (integer)","Input from STDIN (ASCII character)","Input from STDIN (float)","Input from STDIN (integer)","Output to STDOUT (ASCII character)","Output to STDOUT (float)","Output to STDOUT (integer)","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A trait for a target architecture to be compiled to.","Implement a compiler for the given target.","Compile the core variant of the machine code (must be …","","Compile the standard variant of the machine code (should …","","C Target","Compile the declaration of a procedure.","Compile an End instruction (with the matching If or While …","Get a value from the given input stream (mode + channel).","The string used for indentation.","C Target","The name of the target architecture.","Compile a CoreOp instruction.","Peek a value from the device connected to the program.","Poke a value to the device connected to the program.","The code after the function definitions.","The code after the program ends.","The code after each instruction.","The code before the function definitions.","The code before the program starts.","Put a value to the given output stream (mode + channel).","Compile a StandardOp instruction.","Whether or not the target architecture supports floating …","Whether or not the target architecture supports the given …","Whether or not the target architecture supports the given …","The version of the target architecture.","x86 Target","The type for the C target which implements the Target …","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","The type for the C target which implements the Target …","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","The type for the x86 target which implements the Target …","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","Store the inverse-cosine of the register (as a float) into …","Store the inverse-sine of the register (as a float) into …","Store the inverse-tangent of the register (as a float) …","Add the value pointed to on the tape to the register.","Add the value pointed to on the tape to the register (as …","Take the value of the register, and allocate that number …","Perform bitwise nand on the cell and the value pointed to …","Calls the nth function defined in the program, where n is …","Call a foreign function interface function.","A comment in the machine code (not in the compiled output).","The interpreter which runs the virtual machine program.","An individual core virtual machine instruction.","Execute a core instruction.","A program of only core virtual machine instructions.","Store the cosine of the register (as a float) into the …","The pointer is made equal to the value pointed to on the …","Create an input / output device for the virtual machine …","Divide the register by the value pointed to on the tape.","Divide the register by the value pointed to on the tape …","Begin an “else” conditional.","End a conditional.","An error generated by the virtual machine.","When the virtual machine attempts to get the program as …","Free the memory pointed to by the register.","Create a new function.","Get a value from an input source and store it in the …","Begin an “if the register is not zero” conditional.","Interpret the register’s value as a pointer to a cell. …","Make the register equal to 1 if the register is …","Make the register equal to the integer 1 if the register …","Move the pointer on the tape by a number of cells.","Multiply the register by the value pointed to on the tape.","Multiply the register by the value pointed to on the tape …","Get a value from the input interface / device and store it …","Write the value of the register to the output interface / …","Store the value of the register (as a float) to the power …","Write the value of the register to an output source.","The last “deref” operation is undone; the pointer is …","Store the remainder of the register and the value pointed …","Store the remainder of the register and the value pointed …","Store the value pointed to on the tape to the register.","Return from the current function.","Store the register to the value pointed to on the tape.","Set the register equal to a constant value.","Set the register equal to a constant floating point value.","Store the sine of the register (as a float) into the …","A device used for standard input and output. This simply …","The interpreter which runs the standard variant of virtual …","An individual standard virtual machine instruction.","A program of core and standard virtual machine …","Subtract the value pointed to on the tape from the …","Subtract the value pointed to on the tape from the …","Store the tangent of the register (as a float) into the …","A device used for testing the compiler. This simply keeps …","Convert the register from an integer to a float.","Convert the register from a float to an integer.","When an instruction is unsupported for a given …","An interface to conveniently create virtual machine …","Store the value of the pointer to the register.","Begin a “while the register is not zero” loop.","","A function to reinterpret the bits of an integer as a …","A function to reinterpret the bits of a float as an …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","FFI call to the device. This will get the FFI binding for …","","","","","Flatten a core program so that all of its functions are …","Flatten a core program so that all of its functions are …","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Get the next input (from a given input source).","","","","Get the code for each function.","Get the code for each function.","Get the code outside of any functions.","Get the code outside of any functions.","Get the code outside of any functions, and the code for …","Get the code outside of any functions, and the code for …","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","Create a new testing device with some given sample input.","","","","","","Get the output of the testing device as a string (ascii).","","","","","","","Peek at the next value in the FFI buffer for the FFI …","","","","Poke a value into the FFI buffer for the FFI function …","","","","Put the given value to the given output destination.","","","","","","","Run a core program using this interpreter and its device.","Run a core program using this interpreter and its device.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,71,0,71,1,1,1,1,1,71,0,1,71,0,71,71,1,0,71,1,1,1,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,15,15,8,15,8,15,8,15,8,15,8,15,15,15,15,8,15,8,15,15,8,8,15,8,15,15,8,15,8,15,15,15,15,8,8,8,8,15,15,8,15,8,15,8,15,8,15,8,96,97,98,99,100,101,102,103,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,96,97,98,99,100,101,102,116,117,118,119,120,121,122,106,122,105,123,115,123,115,104,105,106,107,108,109,110,111,112,113,114,123,116,117,118,119,120,121,116,0,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,0,21,0,0,0,0,0,0,0,21,21,0,21,0,0,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,9,9,9,9,24,24,9,24,9,24,9,24,9,24,24,24,24,9,24,24,9,9,24,24,9,24,24,9,24,24,24,24,9,24,24,9,24,9,24,9,24,9,24,9,124,125,124,125,126,127,128,129,130,131,124,125,126,127,128,129,130,131,0,0,42,33,0,32,31,26,0,60,30,26,30,32,32,0,31,26,30,31,26,32,0,0,26,0,26,0,0,0,0,0,0,31,30,34,34,31,30,31,30,0,0,32,34,27,0,26,33,34,0,31,32,34,0,34,52,0,31,26,0,26,26,32,52,42,30,31,26,30,0,50,0,0,27,0,31,31,30,0,0,0,50,50,26,26,60,27,26,31,30,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,34,50,50,30,34,34,27,26,26,31,26,32,32,32,31,42,0,60,26,0,32,30,0,32,32,32,34,31,30,0,50,31,31,0,0,33,30,30,31,27,0,42,31,27,30,0,0,32,32,26,42,26,30,0,31,32,31,0,31,27,31,26,33,30,42,31,33,30,32,34,0,31,34,0,26,31,26,33,30,0,31,27,30,0,32,31,32,34,0,26,31,26,30,30,32,32,32,27,27,33,32,26,26,33,27,26,27,29,30,33,26,32,31,26,31,26,30,33,61,62,31,31,31,31,31,26,26,26,26,26,26,26,34,26,34,26,61,62,33,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,38,38,66,66,67,67,68,68,30,60,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,34,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,60,132,132,38,38,66,66,67,67,68,68,40,43,132,31,26,61,62,63,64,38,66,67,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,30,52,33,29,60,29,29,26,26,38,38,66,66,67,67,68,68,52,26,38,66,67,68,34,31,27,26,26,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,33,61,62,63,64,65,60,30,30,34,31,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,31,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,31,26,33,34,29,29,32,32,31,31,27,27,26,26,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,33,33,61,61,62,62,63,63,64,64,65,65,60,60,30,30,34,34,29,32,32,31,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,26,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,60,30,65,26,29,64,29,33,64,33,64,64,26,30,65,64,30,133,133,133,31,26,61,62,63,64,65,30,30,134,134,134,31,26,61,62,63,64,65,29,26,29,30,34,34,31,27,26,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,33,61,62,63,64,65,60,30,26,33,26,33,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,30,34,30,60,34,33,34,26,30,60,34,30,30,30,30,30,34,26,30,26,26,26,26,26,26,26,26,34,26,33,31,65,26,61,62,26,26,43,63,64,65,26,26,38,66,67,68,34,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,60,30,33,26,31,64,26,26,61,62,38,38,66,66,67,67,68,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,64,135,135,31,30,30,30,30,30,30,30,30,30,30,26,30,33,26,26,134,31,26,61,62,63,64,65,30,134,134,33,31,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,26,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,33,136,38,38,66,66,67,67,68,68,31,27,26,33,61,62,63,64,65,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,26,26,30,26,33,31,26,137,138,137,138,139,137,138,139,0,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,0,0,0,0,72,72,72,72,72,0,0,0,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,82,82,82,83,0,82,83,81,83,81,82,82,83,82,83,0,83,82,0,82,82,83,82,83,81,82,82,82,83,0,80,83,82,81,82,82,83,82,0,0,82,82,80,81,82,82,83,83,83,83,83,83,82,81,0,0,82,82,83,82,83,83,83,82,83,81,82,82,81,82,80,83,83,83,83,83,83,83,83,82,83,83,83,82,82,82,83,83,83,83,83,82,82,80,83,83,82,82,81,82,82,79,79,81,79,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,78,20,78,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,79,80,80,81,81,82,82,83,83,84,84,78,78,20,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,78,20,78,20,79,80,81,82,83,84,78,20,78,20,20,20,78,78,78,20,20,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,0,0,140,140,140,140,0,141,141,141,141,0,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,0,0,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,0,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,0,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,86,86,86,85,86,86,85,85,86,85,0,0,86,0,86,85,0,85,86,85,85,0,7,86,85,85,85,85,85,86,85,85,86,86,86,86,85,85,85,86,85,85,85,85,86,86,0,0,0,0,85,86,86,0,86,86,7,0,85,85,91,0,0,142,142,142,142,142,92,93,16,85,25,86,94,91,7,92,93,16,85,25,86,94,91,7,142,16,85,25,86,91,7,16,85,25,86,91,7,16,85,142,16,25,142,92,93,16,25,94,91,142,142,16,85,25,86,7,16,85,94,95,142,94,91,94,16,25,16,85,85,25,86,86,94,91,7,7,92,93,16,85,25,25,86,94,91,7,95,142,94,91,16,25,16,25,16,25,16,85,142,94,92,93,16,85,25,86,94,91,7,142,142,92,93,94,94,142,16,25,94,94,94,16,85,25,86,7,95,142,94,91,95,142,94,91,95,142,94,91,142,142,142,92,93,142,142,142,16,25,16,85,25,86,91,7,16,85,25,86,7,92,93,16,85,25,86,94,91,7,92,93,16,85,25,86,94,91,7,92,93,16,85,25,86,94,91,7,142],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[1,1],[[]],[2],0,[[],3],[[1,1],4],[[1,5],6],[[1,5],6],[7,1],[[]],[3,[[11,[[10,[8,9]]]]]],0,[[]],[12,4],0,[[12,12,3]],[8],[[1,1],[[11,[13]]]],0,[9,[[10,[1]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[15,3],[[10,[16,1]]]],[[]],[[]],[[]],[[]],[15,15],[8,8],[[]],[[]],[[15,15],13],[[8,8],13],0,[15,3],[[],15],[[15,15],4],[[8,8],4],[[],4],[[],4],[[15,5],6],[[15,5],6],[[8,5],6],[[8,5],6],[[]],[[]],[[15,3],[[11,[[10,[8,9]]]]]],[[15,17]],[[8,17]],[[]],[[]],[[15,12],4],[[[18,[8]]],15],[[15,8]],[[15,15],[[11,[13]]]],[[8,8],[[11,[13]]]],[19,8],[[19,20],8],[[21,19],8],[[15,9],[[10,[1]]]],[[]],[[]],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[22,2,3],21],[[]],[[]],[22,22],[[]],[[],22],[[22,5],6],[[22,5],6],[[]],[[22,12],11],[[22,12],[[11,[21]]]],[[22,12],[[11,[3]]]],[22,3],[[]],[[],22],[[22,21],[[10,[21,1]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[21,21],[[]],[[21,21],13],[21,21],[[21,21],4],[[],4],[[21,5],6],[[21,5],6],[[]],[[21,17]],[[]],[[21,23],21],[[21,21],[[11,[13]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[24,3],[[10,[25,1]]]],[[]],[[]],[[]],[[]],[24,24],[9,9],[[]],[[]],0,[24,3],[[],24],[[24,24],4],[[9,9],4],[[24,5],6],[[24,5],6],[[9,5],6],[[9,5],6],[[]],[15,24],[[]],[[24,3],[[11,[[10,[8,9]]]]]],[[]],[[]],[[24,12],4],[[[18,[9]]],24],[[24,8]],[[24,24],[[11,[13]]]],[[9,9],[[11,[13]]]],[[24,9],[[10,[1]]]],[[]],[[]],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[19,[11,[12]]],[[10,[26,2]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[27,[28,[27]]]],[[26,[28,[26]]],26],[[27,[28,[27]]]],[[29,30,19,31],[[10,[32]]]],[[30,29],[[10,[32]]]],[[[18,[33]]],33],[[26,[28,[26]]],26],[[32,34],32],[[31,34],31],[[26,[28,[34]]],26],[[31,[18,[26]]],26],[[26,[18,[26]]],26],[[30,[18,[30]]],30],[[26,[35,[33]],30,29],[[10,[4,32]]]],0,0,[[31,29],[[10,[4,32]]]],[[31,29],[[10,[36,32]]]],[[31,29],[[10,[37,32]]]],[[31,29],[[10,[2,32]]]],[[31,30],31],[[26,30],26],[[26,[39,[38]],[28,[26]]],26],[[26,38,[28,[26]]],26],[[26,[28,[26]]],26],[[26,[28,[26]]],26],[[26,[28,[26]]],26],[26,26],[[34,34]],[[26,[28,[26]]],26],[[34,34]],[[26,[28,[26]]],26],0,0,[4,33],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[30,30,29],[[10,[4,32]]]],[[30,29],[[10,[4,32]]]],[[30,30,29],[[10,[4,32]]]],[[30,30,30,29],[[10,[4,32]]]],[[40,30,30,29],[[10,[4,32]]]],[[41,30,29],[[10,[4,32]]]],[[42,30,30,29],[[10,[4,32]]]],[[43,30,30,29],[[10,[4,32]]]],[[44,30,30,29],[[10,[4,32]]]],[[45,30,30,29],[[10,[4,32]]]],[[46,30,30,29],[[10,[4,32]]]],[[47,30,29],[[10,[4,32]]]],[[48,30,30,29],[[10,[4,32]]]],[[49,30,30,29],[[10,[4,32]]]],[[50,30,30,29],[[10,[4,32]]]],[[51,30,29],[[10,[4,32]]]],[[52,30,29],[[10,[4,32]]]],[[53,30,30,29],[[10,[4,32]]]],[[54,30,30,29],[[10,[4,32]]]],[[55,30,29],[[10,[4,32]]]],[[56,30,29],[[10,[4,32]]]],[[57,30,29],[[10,[4,32]]]],[[58,30,29],[[10,[4,32]]]],[[59,30,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,29],[[10,[4,32]]]],[[26,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,26,26,29],[[10,[4,32]]]],[[26,26,26,29],[[10,[4,32]]]],[[30,30,29],[[10,[4,32]]]],[[60,60],4],[[30,30,29],[[10,[4,32]]]],[34,34],[29,29],[32,32],[31,31],[27,27],[26,26],[40,40],[41,41],[42,42],[43,43],[44,44],[45,45],[46,46],[47,47],[48,48],[49,49],[50,50],[51,51],[52,52],[53,53],[54,54],[55,55],[56,56],[57,57],[58,58],[59,59],[33,33],[61,61],[62,62],[63,63],[64,64],[65,65],[60,60],[30,30],[[],[[39,[38]]]],[[],[[39,[66]]]],[[],[[39,[67]]]],[[],[[39,[68]]]],[40,[[39,[67]]]],[41,[[39,[66]]]],[42,[[39,[67]]]],[43,[[39,[38]]]],[44,[[39,[67]]]],[45,[[39,[67]]]],[46,[[39,[67]]]],[47,[[39,[66]]]],[48,[[39,[67]]]],[49,[[39,[67]]]],[50,[[39,[67]]]],[51,[[39,[66]]]],[52,[[39,[66]]]],[53,[[39,[67]]]],[54,[[39,[67]]]],[55,[[39,[66]]]],[56,[[39,[66]]]],[57,[[39,[66]]]],[58,[[39,[66]]]],[59,[[39,[66]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[38,38],13],[[66,66],13],[[67,67],13],[[68,68],13],[[34,34],13],[[40,40],13],[[41,41],13],[[44,44],13],[[45,45],13],[[46,46],13],[[47,47],13],[[48,48],13],[[49,49],13],[[50,50],13],[[51,51],13],[[52,52],13],[[53,53],13],[[56,56],13],[[57,57],13],[[58,58],13],[[59,59],13],[[60,60],13],[[[0,[69,70]]],[[10,[[10,[15,24]],32]]]],[[[0,[69,70]]],[[10,[[10,[15,24]],32]]]],[[26,26,29,71],[[10,[32]]]],[[26,26,29,71],[[10,[32]]]],[[26,29,71],[[10,[32]]]],[[26,29,71],[[10,[32]]]],[[26,26,29,71],[[10,[32]]]],[[26,26,29,71],[[10,[32]]]],[[26,26,26,29,71],[[10,[32]]]],[[26,26,26,29,71],[[10,[32]]]],[[40,26,26,29,71],[[10,[32]]]],[[43,26,26,29,71],[[10,[32]]]],[[29,71],[[10,[32]]]],[[31,29,71],[[10,[32]]]],[[26,29,71],[[10,[32]]]],[[61,29,71],[[10,[32]]]],[[62,29,71],[[10,[32]]]],[[63,29,71],[[10,[32]]]],[[64,29,71],[[10,[32]]]],[[30,30,29,71],[[10,[32]]]],[[30,29,71],[[10,[32]]]],[[30,30,29,71],[[10,[32]]]],[[30,30,30,29,71],[[10,[32]]]],[[40,30,30,29,71],[[10,[32]]]],[[41,30,29,71],[[10,[32]]]],[[42,30,30,29,71],[[10,[32]]]],[[43,30,30,29,71],[[10,[32]]]],[[44,30,30,29,71],[[10,[32]]]],[[45,30,30,29,71],[[10,[32]]]],[[46,30,30,29,71],[[10,[32]]]],[[47,30,29,71],[[10,[32]]]],[[48,30,30,29,71],[[10,[32]]]],[[49,30,30,29,71],[[10,[32]]]],[[50,30,30,29,71],[[10,[32]]]],[[51,30,29,71],[[10,[32]]]],[[52,30,29,71],[[10,[32]]]],[[53,30,30,29,71],[[10,[32]]]],[[54,30,30,29,71],[[10,[32]]]],[[55,30,29,71],[[10,[32]]]],[[56,30,29,71],[[10,[32]]]],[[57,30,29,71],[[10,[32]]]],[[58,30,29,71],[[10,[32]]]],[[59,30,29,71],[[10,[32]]]],[[30,12],4],[[21,30,29,71],[[10,[32]]]],[[33,26,30,29],[[10,[32]]]],[[],29],[[],60],[[29,18]],[[29,19,60,30],[[10,[23,32]]]],[26,26],[[26,[28,[26]]],26],[[26,26],2],[[26,26],2],[26,2],[26,2],[[26,26],2],[[26,26],2],[[26,26,26],2],[[26,26,26],2],[[21,30,29,71],[[10,[32]]]],[[26,[28,[26]]],26],[[38,38],4],[[66,66],4],[[67,67],4],[[68,68],4],[[34,34],4],[[31,31],4],[[27,27],4],[[26,26],4],[[26,[28,[26]]],26],[[40,40],4],[[41,41],4],[[44,44],4],[[45,45],4],[[46,46],4],[[47,47],4],[[48,48],4],[[49,49],4],[[50,50],4],[[51,51],4],[[52,52],4],[[53,53],4],[[56,56],4],[[57,57],4],[[58,58],4],[[59,59],4],[[33,33],4],[[61,61],4],[[62,62],4],[[63,63],4],[[64,64],4],[[65,65],4],[[60,60],4],[[30,30],4],[[30,30,29],[[10,[4,32]]]],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[31,31,29],[[10,[31,32]]]],[[31,29],[[10,[31,32]]]],[[31,31,29],[[10,[31,32]]]],[[31,31,31,29],[[10,[31,32]]]],[[31,29],[[10,[31,32]]]],[[40,31,31,29],[[10,[31,32]]]],[[41,31,29],[[10,[31,32]]]],[[42,31,31,29],[[10,[31,32]]]],[[43,31,31,29],[[10,[31,32]]]],[[44,31,31,29],[[10,[31,32]]]],[[45,31,31,29],[[10,[31,32]]]],[[46,31,31,29],[[10,[31,32]]]],[[47,31,29],[[10,[31,32]]]],[[48,31,31,29],[[10,[31,32]]]],[[49,31,31,29],[[10,[31,32]]]],[[50,31,31,29],[[10,[31,32]]]],[[51,31,29],[[10,[31,32]]]],[[52,31,29],[[10,[31,32]]]],[[53,31,31,29],[[10,[31,32]]]],[[54,31,31,29],[[10,[31,32]]]],[[55,31,29],[[10,[31,32]]]],[[56,31,29],[[10,[31,32]]]],[[57,31,29],[[10,[31,32]]]],[[58,31,29],[[10,[31,32]]]],[[59,31,29],[[10,[31,32]]]],[[31,31],31],[[26,31],26],[36,33],[[34,5],6],[[29,5],6],[[29,5],6],[[32,5],6],[[32,5],6],[[31,5],6],[[31,5],6],[[27,5],6],[[27,5],6],[[26,5],6],[[26,5],6],[[40,5],6],[[40,5],6],[[41,5],6],[[41,5],6],[[42,5],6],[[42,5],6],[[43,5],6],[[43,5],6],[[44,5],6],[[44,5],6],[[45,5],6],[[45,5],6],[[46,5],6],[[46,5],6],[[47,5],6],[[47,5],6],[[48,5],6],[[48,5],6],[[49,5],6],[[49,5],6],[[50,5],6],[[50,5],6],[[51,5],6],[[51,5],6],[[52,5],6],[[52,5],6],[[53,5],6],[[53,5],6],[[54,5],6],[[54,5],6],[[55,5],6],[[55,5],6],[[56,5],6],[[56,5],6],[[57,5],6],[[57,5],6],[[58,5],6],[[58,5],6],[[59,5],6],[[59,5],6],[[33,5],6],[[33,5],6],[[61,5],6],[[61,5],6],[[62,5],6],[[62,5],6],[[63,5],6],[[63,5],6],[[64,5],6],[[64,5],6],[[65,5],6],[[65,5],6],[[60,5],6],[[60,5],6],[[30,5],6],[[30,5],6],[[]],[72,34],[[]],[1,32],[[]],[[]],[[[39,[27]]],27],[73,27],[[],27],[[],27],[[],27],[[],27],[[],27],[[]],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[[18,[[28,[27]]]]],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[31,26],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[4,60],[[]],[[64,[18,[2]]],65],[[26,[28,[26]]],26],[[29,30],18],[64,35],[[29,30,12],11],[[33,26,30,29],[[10,[[74,[2]],32]]]],[64,26],[[33,26,26,29],[[10,[30,32]]]],[64,[[11,[12]]]],[64,12],[[26,29],[[10,[[11,[60]],32]]]],[[30,30,[74,[2,30]],[75,[2]],29],[[10,[32]]]],[65,12],[64,30],[[30,29],[[11,[60]]]],[29,[[10,[3,32]]]],[29,[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[30,29,3],[[10,[3,32]]]],[[30,29],[[18,[2]]]],[29,[[10,[30,32]]]],[29,[[10,[30,32]]]],[[29,3],[[10,[30,32]]]],[[31,29,3],[[10,[30,32]]]],[[26,29,3],[[10,[30,32]]]],[[61,29,3],[[10,[30,32]]]],[[62,29,3],[[10,[30,32]]]],[[63,29,3],[[10,[30,32]]]],[[64,29,3],[[10,[30,32]]]],[[65,29,3],[[10,[30,32]]]],[[29,30,12],[[11,[30]]]],[[26,[28,[26]]],26],[[29,30,12],4],[[30,30,29],[[10,[4,32]]]],[34,4],[[34,17]],[[31,17]],[[27,17]],[[26,17]],[[40,17]],[[41,17]],[[44,17]],[[45,17]],[[46,17]],[[47,17]],[[48,17]],[[49,17]],[[50,17]],[[51,17]],[[52,17]],[[53,17]],[[56,17]],[[57,17]],[[58,17]],[[59,17]],[[33,17]],[[61,17]],[[62,17]],[[63,17]],[[64,17]],[[65,17]],[[60,17]],[[30,17]],[[26,[28,[26]]],26],[[33,26,26,26,29],[[10,[26,32]]]],[[26,[28,[26]],[28,[26]]],26],[37,33],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[30,4],[34,4],[30,4],[60,4],[34,4],[[33,26,30,29],[[10,[4,32]]]],[34,4],[[26,29],[[10,[4,32]]]],[[30,30,29],[[10,[4,32]]]],[60,4],[34,4],[30,4],[[30,29],[[10,[4,32]]]],[[30,[75,[2]],29],[[10,[4,32]]]],[[30,29],[[10,[4,32]]]],[30,4],[34,4],[[26,[28,[26]]],26],[[12,30,30],30],[[19,31,[28,[26]]],26],[[18,[28,[26]]],26],[[19,64,[28,[26]]],26],[[[73,[12,64]],[28,[26]]],26],[[19,30,[28,[26]]],26],[[18,[28,[26]]],26],[[19,[28,[60]],[11,[30]],[28,[26]],[28,[26]]],26],[[18,[28,[26]]],26],[34,[[11,[72]]]],[[26,[28,[26]]],26],[[26,35,29],[[10,[26,32]]]],[[31,[18,[30]]],31],[[65,[18,[30]],29],[[10,[64,32]]]],[[26,[28,[26]]],26],0,0,[26,26],[[26,[28,[26]]],26],[67,43],[[2,[18,[30]],30],63],[[[11,[2]],18,30,[28,[26]]],64],[[2,[18,[2]],18,30,[28,[26]]],65],[26,26],[[26,[28,[26]]],26],[[38,38],[[11,[13]]]],[[66,66],[[11,[13]]]],[[67,67],[[11,[13]]]],[[68,68],[[11,[13]]]],[[34,34],[[11,[13]]]],[[40,40],[[11,[13]]]],[[41,41],[[11,[13]]]],[[44,44],[[11,[13]]]],[[45,45],[[11,[13]]]],[[46,46],[[11,[13]]]],[[47,47],[[11,[13]]]],[[48,48],[[11,[13]]]],[[49,49],[[11,[13]]]],[[50,50],[[11,[13]]]],[[51,51],[[11,[13]]]],[[52,52],[[11,[13]]]],[[53,53],[[11,[13]]]],[[56,56],[[11,[13]]]],[[57,57],[[11,[13]]]],[[58,58],[[11,[13]]]],[[59,59],[[11,[13]]]],[[60,60],[[11,[13]]]],[[30,29,[74,[30]]],[[10,[30,32]]]],[33,33],[[26,[28,[26]]],26],[[[11,[2]],18,30,[28,[26]]],31],[[64,71]],[[26,[28,[60]]],26],[[26,[28,[26]]],26],0,0,[[26,26,29],[[10,[30,32]]]],[[26,26,29],[[10,[30,32]]]],[[26,29],[[10,[30,32]]]],[[26,29],[[10,[30,32]]]],[[26,26,29],[[10,[30,32]]]],[[26,26,29],[[10,[30,32]]]],[[26,26,26,29],[[10,[30,32]]]],[[26,26,26,29],[[10,[30,32]]]],[[40,26,26,29],[[10,[30,32]]]],[[41,26,29],[[10,[30,32]]]],[[42,26,26,29],[[10,[30,32]]]],[[43,26,26,29],[[10,[30,32]]]],[[44,26,26,29],[[10,[30,32]]]],[[45,26,26,29],[[10,[30,32]]]],[[46,26,26,29],[[10,[30,32]]]],[[47,26,29],[[10,[30,32]]]],[[48,26,26,29],[[10,[30,32]]]],[[49,26,26,29],[[10,[30,32]]]],[[50,26,26,29],[[10,[30,32]]]],[[51,26,29],[[10,[30,32]]]],[[52,26,29],[[10,[30,32]]]],[[53,26,26,29],[[10,[30,32]]]],[[54,26,26,29],[[10,[30,32]]]],[[55,26,29],[[10,[30,32]]]],[[56,26,29],[[10,[30,32]]]],[[57,26,29],[[10,[30,32]]]],[[58,26,29],[[10,[30,32]]]],[[59,26,29],[[10,[30,32]]]],[[64,19]],[29,[[10,[32]]]],[[29,3],[[10,[32]]]],[[31,29,3],[[10,[31,32]]]],[[30,29,3],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29,30,76],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[26,26],[[30,29],30],[[[73,[2,33]]],33],[[[73,[12,26]]],26],[[26,[28,[26]]],26],[[12,30]],[[31,12,30]],[[26,12,30]],[[61,12,30]],[[62,12,30]],[[63,12,30]],[[64,12,30]],[[65,12,30]],[[30,12,30],30],[[[35,[2]],[35,[30]]]],[[[35,[2]],[35,[30]]]],[[[28,[60]],19],33],[[31,[18,[2]]],31],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[26,29],[[10,[26,32]]]],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[[18,[33]]],33],[29,[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,29],[[10,[32]]]],[[26,29],[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,26,26,29],[[10,[32]]]],[[26,26,26,29],[[10,[32]]]],[[31,29],[[10,[32]]]],[[27,29],[[10,[32]]]],[[26,29],[[10,[32]]]],[[33,26,26,29],[[10,[32]]]],[[61,29],[[10,[32]]]],[[62,29],[[10,[32]]]],[[63,29],[[10,[32]]]],[[64,29],[[10,[32]]]],[[65,29],[[10,[32]]]],[[30,29],[[10,[32]]]],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[26,66],26],[19,26],[[[35,[2]],2],[[11,[3]]]],[[26,[28,[26]]],26],[[],33],[[31,[28,[27]]],31],[[26,[28,[27]]],26],0,0,0,0,0,0,0,0,0,[[]],[[]],[72,72],[[]],[[72,72],13],0,[[72,72],4],[[],4],0,[[72,5],6],[[]],[[72,12],2],[[72,17]],[[]],0,0,0,[19,[[10,[[10,[15,24]],2]]]],[[19,[11,[12]]],[[10,[26,2]]]],[19,[[10,[26,2]]]],[19,[[10,[[10,[16,25]],2]]]],[[72,72],[[11,[13]]]],[[]],[[],10],[[],10],[[],14],0,0,0,[[]],[[]],[77,77],[[]],[[77,77],13],[[77,77],4],[[],4],[[77,5],6],[[77,5],6],[[]],[[77,17]],0,[[]],0,[[2,3,3],77],0,[[77,77],[[11,[13]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[],78],[79,79],[80,80],[81,81],[82,82],[83,83],[84,84],[78,78],[20,20],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[79,79],13],[[80,80],13],[[81,81],13],[[82,82],13],[[83,83],13],[[84,84],13],[[78,78],13],[[20,20],13],[[79,79],4],[[80,80],4],[[81,81],4],[[82,82],4],[[83,83],4],[[84,84],4],[[78,78],4],[[20,20],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[79,5],6],[[79,5],6],[[80,5],6],[[80,5],6],[[81,5],6],[[81,5],6],[[82,5],6],[[82,5],6],[[83,5],6],[[83,5],6],[[84,5],6],[[84,5],6],[[78,5],6],[[78,5],6],[[20,5],6],[[20,5],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[79,17]],[[80,17]],[[81,17]],[[82,17]],[[83,17]],[[84,17]],[[78,17]],[[20,17]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[82,3],78],[[83,3],20],[[79,79],[[11,[13]]]],[[80,80],[[11,[13]]]],[[81,81],[[11,[13]]]],[[82,82],[[11,[13]]]],[[83,83],[[11,[13]]]],[[84,84],[[11,[13]]]],[[78,78],[[11,[13]]]],[[20,20],[[11,[13]]]],[[],78],[[],20],[[],20],[[],20],[[],78],[[],78],[[],78],[[],20],[[],20],[[],20],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],0,0,[16,[[10,[2,2]]]],[[85,[18,[85]],[18,[3]],3,3],[[10,[2,2]]]],[25,[[10,[2,2]]]],[[86,[18,[85]],[18,[3]],3,3],[[10,[2,2]]]],0,[3,2],[[85,[11,[3]]],2],[78,[[10,[2,2]]]],[[],[[11,[2]]]],0,[[],12],[85,2],[[],[[10,[2,2]]]],[[],[[10,[2,2]]]],[[[18,[87]]],[[11,[2]]]],[4,[[11,[2]]]],[[],[[11,[2]]]],[[[18,[87]]],[[11,[2]]]],[4,[[11,[2]]]],[20,[[10,[2,2]]]],[86,[[10,[2,2]]]],[[],4],[78,4],[20,4],[[],12],0,0,[[]],[[]],[[88,3],2],[[],88],[[88,85,[11,[3]]],2],[[]],[[88,78],[[10,[2,2]]]],[[]],[88,12],[[88,85],2],[88,[[10,[2,2]]]],[88,[[10,[2,2]]]],[[88,[18,[87]]],[[11,[2]]]],[[88,4],[[11,[2]]]],[88,[[11,[2]]]],[[88,4],[[11,[2]]]],[[88,20],[[10,[2,2]]]],[[88,86],[[10,[2,2]]]],[88,4],[[88,78],4],[[88,20],4],[[],10],[[],10],[[],14],[88,12],0,[[]],[[]],[[89,3],2],[[],89],[[89,85,[11,[3]]],2],[[]],[[89,78],[[10,[2,2]]]],[[]],[89,12],[[89,85],2],[89,[[10,[2,2]]]],[89,[[10,[2,2]]]],[[89,[18,[87]]],[[11,[2]]]],[[89,4],[[11,[2]]]],[89,[[11,[2]]]],[[89,4],[[11,[2]]]],[[89,20],[[10,[2,2]]]],[[89,86],[[10,[2,2]]]],[89,4],[[89,78],4],[[89,20],4],[[],10],[[],10],[[],14],[89,12],0,[[]],[[]],[[90,3],2],[[],90],[[90,85,[11,[3]]],2],[[]],[[90,78],[[10,[2,2]]]],[[]],[90,12],[[90,85],2],[90,[[10,[2,2]]]],[90,[[10,[2,2]]]],[[90,[18,[87]]],[[11,[2]]]],[[90,4],[[11,[2]]]],[90,[[11,[2]]]],[[90,4],[[11,[2]]]],[[90,20],[[10,[2,2]]]],[[90,86],[[10,[2,2]]]],[90,4],[[90,78],4],[[90,20],4],[[],10],[[],10],[[],14],[90,12],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[91,77]],[37,36],[36,37],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[16,16],[85,85],[25,25],[86,86],[91,91],[7,7],[[]],[[]],[[]],[[]],[[]],[[]],[[16,16],13],[[85,85],13],[[],[[10,[16,25]]]],[16,[[10,[16,25]]]],[25,[[10,[16,25]]]],[12],[[],[[92,[91]]]],[[],[[93,[91]]]],[[],16],[[],25],[[],94],[[],91],[[]],[[]],[[16,16],4],[[85,85],4],[[25,25],4],[[86,86],4],[[7,7],4],[[],4],[[],4],0,[[77,[11,[[18,[37]]]]],[[10,[2]]]],[77,[[10,[7]]]],[[94,77,[11,[[18,[37]]]]],[[10,[2]]]],[[91,77,[11,[[18,[37]]]]],[[10,[2]]]],0,[16,16],[25,25],[[16,5],6],[[85,5],6],[[85,5],6],[[25,5],6],[[86,5],6],[[86,5],6],[[94,5],6],[[91,5],6],[[7,5],6],[[7,5],6],[[]],[[]],[[]],[[]],[[]],[16,25],[[]],[[]],[[]],[[]],[78,[[10,[37,2]]]],[78],[[94,78],[[10,[37,2]]]],[[91,78],[[10,[37,2]]]],[16,[[74,[87,[18,[85]]]]]],[25,[[74,[87,[18,[86]]]]]],[16,[[18,[85]]]],[25,[[18,[86]]]],[16],[25],[[16,17]],[[85,17]],[[]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[23],[95,[[92,[95]]]],[95,[[93,[95]]]],[19,94],[[[18,[37]]],94],[85],[[16,85]],[[25,85]],0,[94,2],[94,[[18,[37]]]],[[16,16],[[11,[13]]]],[[85,85],[[11,[13]]]],[[25,25],[[11,[13]]]],[[86,86],[[11,[13]]]],[[7,7],[[11,[13]]]],[[],[[10,[37,2]]]],[[],[[10,[7]]]],[94,[[10,[37,2]]]],[91,[[10,[37,2]]]],[37,[[10,[2]]]],[[],[[10,[7]]]],[[94,37],[[10,[2]]]],[[91,37],[[10,[2]]]],[[37,20],[[10,[2]]]],[20],[[94,37,20],[[10,[2]]]],[[91,37,20],[[10,[2]]]],[[]],[[]],[[]],[[[92,[95]],16],[[10,[95,2]]]],[[[93,[95]],25],[[10,[95,2]]]],[[]],[37],[86,[[10,[7]]]],[[16,86],[[10,[7]]]],[[25,86],[[10,[7]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[],2],[[],2],[[],2],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[]]],"c":[],"p":[[4,"Error"],[3,"String"],[15,"usize"],[15,"bool"],[3,"Formatter"],[6,"Result"],[4,"Error"],[4,"CoreOp"],[4,"StandardOp"],[4,"Result"],[4,"Option"],[15,"str"],[4,"Ordering"],[3,"TypeId"],[3,"CoreProgram"],[3,"CoreProgram"],[8,"Hasher"],[3,"Vec"],[8,"ToString"],[3,"Output"],[4,"Location"],[3,"Globals"],[15,"isize"],[3,"StandardProgram"],[3,"StandardProgram"],[4,"Expr"],[4,"Declaration"],[8,"Into"],[3,"Env"],[4,"Type"],[4,"ConstExpr"],[4,"Error"],[4,"Pattern"],[4,"Annotation"],[15,"slice"],[15,"f64"],[15,"i64"],[8,"AssignOp"],[3,"Box"],[3,"Add"],[3,"Negate"],[4,"Arithmetic"],[3,"Assign"],[3,"BitwiseAnd"],[3,"BitwiseNand"],[3,"BitwiseNor"],[3,"BitwiseNot"],[3,"BitwiseOr"],[3,"BitwiseXor"],[4,"Comparison"],[3,"Get"],[4,"Put"],[3,"And"],[3,"Or"],[3,"Not"],[3,"New"],[3,"Delete"],[3,"Tag"],[3,"Data"],[4,"Mutability"],[3,"CoreBuiltin"],[3,"StandardBuiltin"],[3,"FFIProcedure"],[3,"Procedure"],[3,"PolyProcedure"],[8,"UnaryOp"],[8,"BinaryOp"],[8,"TernaryOp"],[8,"Sized"],[8,"Clone"],[8,"AssemblyProgram"],[3,"SourceCodeLocation"],[3,"BTreeMap"],[3,"HashMap"],[3,"HashSet"],[8,"Fn"],[3,"FFIBinding"],[3,"Input"],[4,"Axis"],[4,"Direction"],[4,"Color"],[4,"InputMode"],[4,"OutputMode"],[3,"Channel"],[4,"CoreOp"],[4,"StandardOp"],[15,"i32"],[3,"C"],[3,"MyOS"],[3,"X86"],[3,"StandardDevice"],[3,"CoreInterpreter"],[3,"StandardInterpreter"],[3,"TestingDevice"],[8,"Device"],[13,"Compare"],[13,"IsGreater"],[13,"IsGreaterEqual"],[13,"IsLess"],[13,"IsLessEqual"],[13,"IsEqual"],[13,"IsNotEqual"],[13,"GetAddress"],[13,"Move"],[13,"Copy"],[13,"Index"],[13,"Add"],[13,"Sub"],[13,"Mul"],[13,"Div"],[13,"Rem"],[13,"DivRem"],[13,"And"],[13,"Or"],[13,"PopFrom"],[13,"Array"],[13,"BitwiseNand"],[13,"BitwiseXor"],[13,"BitwiseOr"],[13,"BitwiseNor"],[13,"BitwiseAnd"],[13,"Global"],[13,"PushTo"],[13,"IsGreater"],[13,"IsLess"],[13,"Pow"],[13,"Add"],[13,"Sub"],[13,"Mul"],[13,"Div"],[13,"Rem"],[8,"Compile"],[8,"GetSize"],[8,"GetType"],[8,"Simplify"],[8,"TypeCheck"],[13,"MismatchedTypes"],[13,"MismatchedMutability"],[13,"NonExhaustivePatterns"],[8,"CompiledTarget"],[8,"Architecture"],[8,"VirtualMachineProgram"]]}\ +"sage":{"doc":"The Sage Programming Language","t":"RRRAAAAAAACICCCCCCECCCCCCCCCNNNNNNLLLLLAKLLLLLKALKALKLAKLLLLLNNNNNNNNNNNNNNEDNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMDLLLLLLLLLLLLLLLLLLLLLRNRRRRRRRNNENRRLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNEDNNNNLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMFDNNDNNNENNNNNNENNNNNNDININDDDDDDNNSSNNNNEINNNENNNDNNSDNNENNDNNNNNNNNNDNEENDNNNDIINNNNNNNNNNNNNNNNNNNNNNNNNNSNNNNNNNNNNNNNNNENSDNNDNNNNNNDNNNDENNNNNDNNNNDENNNNNSINNNDNNNNNNNNNNNSDNNINNNNNENNNINNNSINNNNNNNNNNNNNNNLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMDLLLLLMLLMLLLLLMMMFFFFLLLLLAADLLLLLLLLLLLMLMLMLLLLLLNNNNENNNNNNNNNNDNNENNNNNNNNNNENNNNNNNNDENNNNNNNNNNNNNNDENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLIILLLLAKKKLKKKKLLLLLKAKKKKKADLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNDENDNNINNNNENNNNNNNNNNNNNNNNNNNNNNNNDDEDNNNDNNNINNLFFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLMKLLLMLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLMLLLLLLLLLLLLLLLKLLMLLLLLLLKLLLKLLLKLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["LOGO","LOGO_WITH_COLOR","NULL","asm","frontend","lir","parse","side_effects","targets","vm","A","AssemblyProgram","B","C","CoreOp","CoreProgram","D","E","Error","F","FP","GP","Globals","Location","REGISTERS","SP","StandardOp","StandardProgram","UndefinedGlobal","UndefinedLabel","Unexpected","Unmatched","UnsupportedInstruction","VirtualMachineError","borrow","borrow_mut","clone","clone_into","comment","core","current_instruction","eq","fmt","fmt","from","from","get_op","globals","into","is_defined","location","log_instructions_after","op","partial_cmp","std","std_op","to_owned","to_string","try_from","try_into","type_id","Add","And","Array","BitwiseAnd","BitwiseNand","BitwiseNor","BitwiseNot","BitwiseOr","BitwiseXor","Call","CallLabel","Comment","Compare","Copy","CoreOp","CoreProgram","Dec","Div","DivRem","Else","End","Fn","Get","GetAddress","Global","If","Inc","Index","IsEqual","IsGreater","IsGreaterEqual","IsLess","IsLessEqual","IsNotEqual","Many","Move","Mul","Neg","Next","Not","Or","Pop","PopFrom","Prev","Push","PushTo","Put","Rem","Return","Set","SetLabel","Sub","Swap","While","assemble","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","cmp","cmp","code","current_instruction","default","eq","eq","equivalent","equivalent","fmt","fmt","fmt","fmt","from","from","get_op","hash","hash","into","into","is_defined","new","op","partial_cmp","partial_cmp","push_string","put_string","stack_alloc_string","std_op","to_owned","to_owned","to_string","to_string","try_from","try_from","try_into","try_into","type_id","type_id","a","a","a","a","a","a","a","addr","b","b","b","b","b","b","b","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","dst","name","offset","size","size","size","size","sp","sp","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","src","vals","Globals","add_global","borrow","borrow_mut","clone","clone_into","default","fmt","fmt","from","get_global","get_global_location","get_global_size","get_size","into","new","resolve","to_owned","to_string","try_from","try_into","type_id","A","Address","B","C","D","E","F","FP","GP","Global","Indirect","Location","Offset","REGISTERS","SP","borrow","borrow_mut","clone","clone_into","cmp","deref","eq","equivalent","fmt","fmt","from","hash","into","offset","partial_cmp","to_owned","to_string","try_from","try_into","type_id","ACos","ASin","ATan","Add","Alloc","Call","CoreOp","Cos","Div","Free","IsGreater","IsLess","Mul","Neg","Pow","Rem","Set","Sin","Sqrt","StandardOp","StandardProgram","Sub","Tan","ToFloat","ToInt","assemble","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","code","current_instruction","default","eq","eq","fmt","fmt","fmt","fmt","from","from","from","get_op","into","into","is_defined","new","op","partial_cmp","partial_cmp","std_op","to_owned","to_owned","to_string","to_string","try_from","try_from","try_into","try_into","type_id","type_id","a","a","b","b","dst","dst","dst","dst","dst","dst","dst","dst","src","src","src","src","src","src","parse","Add","Add","Alt","And","Annotated","Annotated","Annotated","Annotation","Any","Any","Apply","Apply","ApplyNonProc","ApplyNonTemplate","Arithmetic","Array","Array","Array","As","As","AssemblyError","Assign","AssignOp","AssignOp","BinaryOp","BinaryOp","BitwiseAnd","BitwiseNand","BitwiseNor","BitwiseNot","BitwiseOr","BitwiseXor","Bool","Bool","COMPILER_GENERATED","CONSTANT","Cell","Cell","Char","Char","Comparison","Compile","CompilePolyProc","CompilerGenerated","Const","ConstExpr","ConstExpr","ConstExpr","Constant","CoreBuiltin","CoreBuiltin","CouldntSimplify","DEAD_CODE","Data","DeadCode","Debug","Declaration","Declare","Declare","Delete","Deref","DerefMut","DerefNonPointer","Display","Divide","Enum","EnumUnion","EnumUnion","EnumUnion","Env","Equal","Error","Expr","ExternProc","FFIProcedure","FFIProcedure","Float","Float","Get","GetSize","GetType","GreaterThan","GreaterThanOrEqual","If","IfLet","Immutable","Impl","Index","Int","Int","InvalidAs","InvalidAssignOp","InvalidAssignOpTypes","InvalidBinaryOp","InvalidBinaryOpTypes","InvalidConstExpr","InvalidIndex","InvalidMatchExpr","InvalidMonomorphize","InvalidPatternForExpr","InvalidPatternForType","InvalidRefer","InvalidTemplateArgs","InvalidTernaryOp","InvalidTernaryOpTypes","InvalidUnaryOp","InvalidUnaryOpTypes","LIVE_CODE","LessThan","LessThanOrEqual","Let","Location","Many","Many","Many","Match","Member","Member","MemberNotFound","MismatchedMutability","MismatchedTypes","Monomorphize","Multiply","Mutability","Mutable","NONE","Negate","NegativeArrayLength","Never","New","NonExhaustivePatterns","NonIntegralConst","NonSymbol","None","None","None","Not","NotEqual","Null","Of","Or","Pattern","Pointer","Pointer","Poly","PolyProc","PolyProc","PolyProcedure","Power","Proc","Proc","Proc","Procedure","Put","RecursionDepthConst","RecursionDepthTypeEquality","Refer","Remainder","Return","SIMPLIFY_RECURSION_LIMIT","Simplify","SizeOfExpr","SizeOfTemplate","SizeOfType","StandardBuiltin","StandardBuiltin","StaticVar","Struct","Struct","Struct","Struct","Subtract","Symbol","Symbol","Symbol","SymbolNotDefined","TEMPORARY","Tag","Template","Temporary","TernaryOp","TernaryOp","Tuple","Tuple","Tuple","Tuple","Type","Type","Type","Type","TypeCheck","TypeNotDefined","TypeOf","TypeRedefined","USER_GENERATED","UnaryOp","UnaryOp","Union","Union","Union","Unit","UnsizedType","UnsupportedOperation","UnusedExpr","Var","VarPat","Variant","VariantNotFound","When","While","Wildcard","add","add","add_assign","add_associated_const","add_monomorphized_associated_consts","alt","and","annotate","annotate","annotate","app","app","apply","are_patterns_exhaustive","args","args","as_bool","as_float","as_int","as_symbol","as_type","as_type","assign","assign_op","bitand","bitnand","bitnor","bitnot","bitor","bitor","bitor_assign","bitxor","body","body","bool","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_apply_exprs","can_cast_to","can_decay_to","can_decay_to","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_box","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile","compile_expr","compile_expr","compile_expr","compile_expr","compile_expr","compile_expr","compile_expr","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","compile_types","contains_symbol","debug","declare_let_bind","default","default","define_types","define_var","deref","deref_mut","display","display","display","display","display","display","display","display","display","div","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","equals","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","eval","field","field","float","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_mono","ge","get_all_associated_consts","get_args","get_associated_const","get_bindings","get_body","get_branch_result_type","get_common_name","get_mangled_name","get_method_call_mutability","get_monomorph_template_args","get_name","get_ret","get_self_param_mutability","get_size","get_size","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_size_checked","get_template_params","get_type","get_type","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_checked","get_type_of_associated_const","gt","has_associated_const","has_element_type","has_location","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","idx","if_let_pattern","if_then","int","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","is_atomic","is_compiler_generated","is_concrete","is_constant","is_dead_code","is_exhaustive","is_location","is_method_call","is_monomorph_of","is_mutable","is_none","is_poly","is_recursive","is_recursive_helper","is_self_param_reference","is_simple","is_temporary","le","let_bind","let_const","let_consts","let_proc","let_procs","let_type","let_types","let_var","let_vars","location","lt","match_pattern","monomorphize","monomorphize","mul","name","name","neg","neq","new","new","new","new","not","or","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","perform_template_applications","pointer","pow","proc","push_label","refer","rem","ret","ret","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","return_type","set_common_name","simplify","simplify_checked","simplify_checked","simplify_checked","simplify_until_atomic","simplify_until_concrete","simplify_until_has_members","simplify_until_has_variants","simplify_until_matches","simplify_until_poly","simplify_until_simple","simplify_until_type_checks","simplify_until_union","size_of","strip_template","struct_","structure","sub","substitute","substitute","substitute","substitute","substitute","substitute","substitute","substitute","substitute","substitute_types","substitute_types","sym","template","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","transform_method_call","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tup","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_check","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unop","var","variant_index","while_loop","wildcard","with","with","expected","expected","expr","expr","expr","found","found","patterns","SourceCodeLocation","borrow","borrow_mut","clone","clone_into","cmp","column","eq","equivalent","filename","fmt","from","get_code","hash","into","length","line","offset","parse_asm","parse_frontend","parse_lir","parse_vm","partial_cmp","to_owned","try_from","try_into","type_id","ffi","io","FFIBinding","borrow","borrow_mut","clone","clone_into","cmp","eq","equivalent","fmt","fmt","from","hash","input_cells","into","name","new","output_cells","partial_cmp","to_owned","to_string","try_from","try_into","type_id","Accelerometer","Altimeter","AnalogPin","AnalogPin","Axis","Barometer","Bell","Black","Blower","Blue","BlueLight","Brightness","Brightness","Button","Buzzer","Channel","ClearDisplay","Clock","Color","Compass","ConductivitySensor","Cooler","Custom","Custom","Cyan","DPad","DepthSensor","DigitalPin","DigitalPin","Direction","Down","Fan","FlowSensor","Green","GreenLight","Gyroscope","Heater","Humidity","Input","InputMode","JoyStick","Keyboard","Left","Magenta","Magnetometer","Microphone","MotorSpeed","MoveCursorDown","MoveCursorLeft","MoveCursorRight","MoveCursorUp","Note","Odometer","Orange","Output","OutputMode","PHSensor","Position","Pressure","PressureGauge","PrinterChar","PrinterFloat","PrinterInt","Proximity","Pump","RGB","RainGauge","Random","Red","RedLight","Right","Servo","SetCursorChar","SetCursorColumn","SetCursorPixel","SetCursorRow","Solenoid","SpeakerFrequency","SpeakerVolume","Speedometer","StderrChar","StderrFloat","StderrInt","StdinChar","StdinFloat","StdinInt","StdoutChar","StdoutFloat","StdoutInt","StepperMotor","Temperature","Thermometer","UVSensor","Up","UpdateDisplay","Valve","VolumeSensor","WeightSensor","White","WindDirection","WindSpeed","X","Y","Yellow","Z","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","channel","channel","clock","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","cmp","cmp","cmp","cmp","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","hash","hash","hash","hash","hash","hash","hash","hash","into","into","into","into","into","into","into","into","mode","mode","new","new","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","random","stderr_char","stderr_float","stderr_int","stdin_char","stdin_float","stdin_int","stdout_char","stdout_float","stdout_int","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","Architecture","CompiledTarget","build_core","build_op","build_std","build_std_op","c","declare_proc","end","get","indentation","name","op","peek","poke","post_funs","postlude","postop","pre_funs","prelude","put","sage_os","std_op","supports_floats","supports_input","supports_output","version","x86","C","borrow","borrow_mut","declare_proc","default","end","from","get","into","name","op","peek","poke","post_funs","postlude","postop","prelude","put","std_op","supports_floats","supports_input","supports_output","try_from","try_into","type_id","version","SageOS","borrow","borrow_mut","declare_proc","default","end","from","get","into","name","op","peek","poke","post_funs","postlude","postop","prelude","put","std_op","supports_floats","supports_input","supports_output","try_from","try_into","type_id","version","X86","borrow","borrow_mut","declare_proc","default","end","from","get","into","name","op","peek","poke","post_funs","postlude","postop","prelude","put","std_op","supports_floats","supports_input","supports_output","try_from","try_into","type_id","version","ACos","ASin","ATan","Add","Add","Alloc","BitwiseNand","Call","Call","Comment","CoreInterpreter","CoreOp","CoreOp","CoreProgram","Cos","Deref","Device","Div","Div","Else","End","Error","ExpectedCore","Free","Function","Get","If","Index","IsNonNegative","IsNonNegative","Move","Mul","Mul","Peek","Poke","Pow","Put","Refer","Rem","Rem","Restore","Return","Save","Set","Set","Sin","StandardDevice","StandardInterpreter","StandardOp","StandardProgram","Sub","Sub","Tan","TestingDevice","ToFloat","ToInt","UnsupportedInstruction","VirtualMachineProgram","Where","While","add_binding","as_float","as_int","begin_else","begin_function","begin_if","begin_while","bitwise_nand","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","code","code","code","comment","default","default","default","default","default","default","deref","end","eq","eq","eq","eq","eq","equivalent","equivalent","ffi","ffi_call","ffi_call","ffi_call","ffi_call","ffi_channel","flatten","flatten","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","get","get","get","get","get_functions","get_functions","get_main","get_main","get_main_and_functions","get_main_and_functions","hash","hash","index","input","into","into","into","into","into","into","into","into","into","is_non_negative","move_pointer","new","new","new","new_raw","op","op","op","output","output_str","output_vals","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","peek","peek","peek","peek","poke","poke","poke","poke","put","put","put","put","refer","restore","ret","run","run","save","set_register","std_op","std_op","std_op","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","where_is_pointer"],"q":[[0,"sage"],[10,"sage::asm"],[61,"sage::asm::core"],[163,"sage::asm::core::CoreOp"],[231,"sage::asm::globals"],[253,"sage::asm::location"],[288,"sage::asm::std"],[353,"sage::asm::std::StandardOp"],[371,"sage::frontend"],[372,"sage::lir"],[1551,"sage::lir::Error"],[1559,"sage::parse"],[1586,"sage::side_effects"],[1588,"sage::side_effects::ffi"],[1611,"sage::side_effects::io"],[1877,"sage::targets"],[1905,"sage::targets::c"],[1931,"sage::targets::sage_os"],[1957,"sage::targets::x86"],[1983,"sage::vm"]],"d":["The UNICODE character art for the logo of the language.","The UNICODE character art for the logo of the language, …","The value of the NULL pointer constant.","Assembly Module","","LIR (Low Intermediate Representation) Module","Parsing Module","","Targets Module","Virtual Machine Module","","A frontend to both the CoreProgram and StandardProgram …","","","","","","","An error generated by assembling some assembly language …","","","","","","","","","","The given global was not defined.","The given label was not defined.","The given instruction was not expected, or cannot be used …","The given instruction did not have a matching “end”. …","Is this standard assembly operation supported by the …","An error generated by the virtual machine.","","","","","Insert a comment into the program.","Core Assembly Variant","Get the current instruction number.","","","","","Returns the argument unchanged.","Get the operation at the given instruction number.","","Calls U::from(self).","Is the given label defined yet in the operations? I.E., …","Assembly Memory Location","Log all the instructions after the given instruction …","Insert a core operation into the program.","","Standard Assembly Variant","Attempt to insert a standard operation into the program. …","","","","","","Add an integer value from a source location to a …","Logical “and” a destination with a source value.","Store a list of values at a source location. Then, store …","","","","","","","Get a value in memory and call it as a label ID.","Call a function with a given label.","","Store the comparison of “a” and “b” in a …","Copy a number of cells from a source referenced location …","A core instruction of the assembly language. These are …","An assembly program composed of core instructions, which …","Decrement the integer value of a location.","Divide a destination location by a source value.","Divide a destination location by a source value. Store the …","Add an “else” clause to an “if the value is not zero…","Terminate a function declaration, a while loop, an if …","Declare a new label.","Get a value from the input device / interface and store it …","Get the address of a location, and store it in a …","Declare a global variable.","Begin an “if the value is not zero” statement over a …","Increment the integer value of a location.","Get the address of a location indexed by an offset stored …","Perform dst = a == b.","Perform dst = a > b.","Perform dst = a >= b.","Perform dst = a < b.","Perform dst = a <= b.","Perform dst = a != b.","Many instructions to execute; conveniently grouped …","Copy a value from a source location to a destination …","Multiply a destination location by a source value.","Negate an integer.","Make this pointer point to the next cell (or the nth next …","Replace a value in memory with its boolean complement.","Logical “or” a destination with a source value.","Pop a number of cells from the stack and store it in a …","Pop a number of cells from a specified stack and store it …","Make this pointer point to the previous cell (or the nth …","Push a number of cells starting at a memory location on …","Push a number of cells starting at a memory location onto …","Put a value from a source register to the output device / …","Store the remainder of the destination modulus the source …","Return from the current function.","Set the value of a register, or any location in memory, to …","Set the value of a register, or any location in memory, to …","Subtract a source integer value from a destination …","Swap the values of two locations.","Begin a “while the value is not zero” loop over a …","Assemble a program of core assembly instructions into the …","","","","","","","","","","","The list of core assembly instructions in the program.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","","Create a new program of core assembly instructions.","","","","Push a string literal as UTF-8 to the stack.","Put a string literal as UTF-8 to the output device.","Allocate a string on the stack, and store its address in a …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A lookup for all the global variables in an assembly …","Add a global variable to the list of globals.","","","","","Create a new empty Globals lookup.","","","Returns the argument unchanged.","Get the location, and size of a global variable.","Get the location of a global variable.","Get the size of a global variable. This is the number of …","Get the size of the global variables. This is the number …","Calls U::from(self).","Create a new empty Globals lookup.","Resolve the global variables in a location to produce an …","","","","","","The “A” general purpose register.","A fixed position in the tape (a constant address known at …","The “B” general purpose register.","The “C” general purpose register.","The “D” general purpose register.","The “E” general purpose register.","The “F” general purpose register.","The frame pointer register.","The Global Pointer register. This is used to access global …","A global variable.","Use the value of a cell on the tape as an address. For …","A location in memory (on the tape of the virtual machine).","Go to a position in memory, and then move the pointer …","","The stack pointer register.","","","","","","Get the location of the value pointed to by this location.","","","","","Returns the argument unchanged.","","Calls U::from(self).","Get the location offset by a constant number of cells from …","","","","","","","Perform inverse Cos on a cell (float) and store the result …","Perform inverse Sin on a cell (float) and store the result …","Perform inverse Tan on a cell (float) and store the result …","Add the source cell (float) to the destination cell …","Take the value in the operand cell. Allocate that number …","Call a foreign function.","Execute a core instruction.","Perform Cos on a cell (float) and store the result in the …","Divide the destination cell (float) by the source cell …","Free the memory allocated at the address stored in the …","Perform dst = a > b.","Perform dst = a < b.","Multiply the source cell (float) by the destination cell …","Negate the value of a cell (float) and store the result in …","Raise a cell (float) to the power of another cell (float).","Perform the modulo operation on the destination cell …","Set the value of a cell to a constant float.","Perform Sin on a cell (float) and store the result in the …","Take the square root of a cell (float).","A standard instruction of the assembly language. These are …","A program composed of standard instructions, which can be …","Subtract the source cell (float) from the destination cell …","Perform Tan on a cell (float) and store the result in the …","Take the integer value stored in a cell and store the …","Take the float value stored in a cell and store the …","Assemble the program into a virtual machine program.","","","","","","","","","The list of standard assembly instructions in the program.","Get the current instruction number.","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Get the operation at the given instruction number.","Calls U::from(self).","Calls U::from(self).","Is the given label defined yet in the operations?","Create a new program of core assembly instructions.","Add a core operation to the program.","","","Add a standard operation to the program.","","","","","","","","","","","The first cell in the comparison (left hand side).","The first cell in the comparison (left hand side).","The second cell in the comparison (right hand side).","The second cell in the comparison (right hand side).","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The destination cell.","The source cell.","The source cell.","The source cell.","The source cell.","The source cell.","The source cell.","","","","","A boolean “And” operation between two values.","An error with some annotation about the source code that …","","An expression along with data about its source code …","An annotation for metadata about an LIR expression. This …","Unchecked access to a value. This is used to override …","A type reserved by the compiler. This type is equal to any …","Apply a function with some arguments.","A type that constructs a concrete type from a polymorphic …","Tried to apply a non-procedure to some arguments.","Tried to apply a non-template type to some arguments.","An arithmetic operation.","An array of constant values.","An array of expressions.","An array of a given type, with a constant size.","Cast a constant expression to another type.","Cast an expression to another type.","An error caused by trying to assemble invalid code …","An assignment operation. This is used to implement …","A trait used to implemented an assignment operation.","Perform an assignment operation on two expressions.","A trait used to implement a binary operation.","Perform a binary operation on two expressions.","A boolean “BitwiseAnd” operation between two values.","A boolean “BitwiseNand” operation between two values.","A boolean “BitwiseNor” operation between two values.","","A boolean “BitwiseOr” operation between two values.","A boolean “BitwiseXor” operation between two values.","A constant boolean value.","The type of a boolean value.","An annotation for compiler-generated code.","An annotation for a constant.","A constant integer value representing a cell on the tape.","The type of the most basic unit of memory.","A constant chararacter.","The type of a character.","A comparison operation between two values.","A trait which allows an LIR expression to be compiled to …","Tried to compile a polymorphic procedure without …","Is this expression compiler-generated?","A constant expression.","A compiletime expression.","A constant expression.","","Is this expression a constant?","A builtin pseudo-procedure implemented in the core …","A builtin implemented in handwritten core assembly.","Recursion depth exceeded when trying to confirm a type’s …","An annotation for dead code.","Get the Union data associated with a tagged union …","Is this expression dead code?","","A declaration of a variable, function, type, etc.","Bind a list of types in a constant expression.","Declare any number of variables, procedures, types, or …","","Dereference this expression (i.e. get the value it points …","Store an expression to an address (a pointer).","Tried to dereference a non-pointer.","","","An enumeration of a list of possible named values. A …","A tagged union of constant values.","A tagged union: a typechecked union of different variants. …","An enumeration of a list of possible types. This is a sum …","An environment under which expressions and types are …","","An LIR compilation error.","TODO: Add variants for LetProc, LetVar, etc. to support …","A foreign function declaration.","A typed procedure which calls a foreign function. This is …","A foreign function interface binding.","A constant floating point value.","The floating-point number type.","","Get the size of something in memory (number of cells).","Get the type associated with a value under a given …","","","An if-then-else expression.","An if-let expression.","Immutable access to a value. This is the default way to …","Declare associated constants and procedures for a type.","Index an array or pointer with an expression that …","A constant integer value.","The integer type.","Invalid type casting expression.","Invalid assignment operation (assign, add_assign, …","Invalid assign op types (incorrect types).","Invalid binary operation (add, subtract, and, or) …","Invalid binary op types (incorrect types).","Invalid constant expression.","Invalid Index expression (incorrect types).","Tried to match over an expression that cannot be matched …","Cannot monomorphize a constant expression.","Tried to use a pattern that is not valid for the given …","Tried to use a pattern that is not valid for the given …","Invalid Refer expression. The compiler was not able to …","Invalid number of template arguments to a type.","Invalid ternary operation (if) expression (incorrect …","Invalid ternary op types (incorrect types).","Invalid unary operation (negate, not) expression …","Invalid unary op types (incorrect types).","An annotation for live code.","","","Bind a type to a name in a temporary scope.","The source code location of the expression.","Many annotations can be attached to an expression. This is …","Many declarations.","A block of expressions. The last expression in the block …","A match expression.","Get an attribute of a constant expression.","Get a field or member from a structure, union, or tuple. …","Tried to access an undefined member of a tuple, struct, or …","Mismatched mutability","Mismatched types","Monomorphize a constant expression with some type …","","Mutability of a pointer. This is used to provide type …","Mutable access to a value.","A constant expression that evaluates to None. This …","","Tried to create an array with a negative length.","The type of an expression that will never return, or doesn…","","Invalid pattern for a match expression.","Got another type when expecting an integer, bool, or char.","Expected a symbol, but got something else.","No annotation.","The unit, or “void” instance.","The type of void expressions.","A boolean “Not” operation on a value.","","The null pointer constant.","A constant enum variant.","A boolean “Or” operation between two values.","A pattern which can be matched against an expression.","","A pointer to another type.","A polymorphic, parametric type. This type is used with the …","A polymorphic procedure.","A polymorphic procedure declaration.","A polymorphic procedure of LIR code which can be applied …","","A procedure.","A procedure declaration.","A procedure with a list of parameters and a return type.","A monomorphic procedure of LIR code which can be applied …","Print a value to a given output.","Recursion depth exceeded when trying to evaluate a …","Recursion depth exceeded when trying to confirm a type’s …","Reference this expression (i.e. get a pointer to it).","","Return a value from a function.","This is the maximum number of times a type will be …","Simplify an expression while maintaining structural …","Get the size of an expression’s type (in cells) as a …","Tried to get the size of a template type.","Get the size of a type (in cells) as a constant int.","A builtin pseudo-procedure implemented in the standard …","A builtin implemented in handwritten standard assembly.","A static variable declaration.","A structure of constant values.","A structure of fields to expressions.","","A tuple with named members. This is a product type.","","A named constant.","","A named type.","A symbol was used, but not defined.","An annotation for a temporary.","Get the Enum value of the tag associated with a tagged …","","Is this expression a temporary?","A trait used to implement a ternary operation.","Perform a ternary operation on three expressions.","A tuple of constant values.","A tuple of expressions.","","A heterogenous collection of types. This is a product type.","The representation of a type in the LIR type system.","A type as a constant expression.","A type declaration.","A trait object. This is internally represented as an …","A trait used to enforce type checking.","A type was used, but not defined.","Get the type of an expression. (as an array of chars)","Tried to define a type that already exists.","An annotation for user-generated code.","A trait used to implement a unary operation.","Perform a unary operation on two expressions.","A union of constant values.","A union: a collection of named fields. The Type value is …","A union of a list of possible types mapped to named …","This type is identified by its name. Most types are …","Tried to instantiate a type that cannot be sized. This is …","Expression uses an operation unsupported by the target.","Unused expression returned a non-None value.","A variable declaration.","A variable declaration with a pattern.","","The variant of an enum is not defined.","A constant, compile time if-then-else expression.","Create a while loop: while the first expression evaluates …","","","Add this expression to another.","","","","Construct a new pattern which binds to several alternate …","Logical and this expression with another.","Annotate an error with some metadata.","Annotate this constant expression with a source code …","An annotated expression with some metadata.","Apply this procedure or builtin to a list of expressions …","Apply this expression as a procedure to some arguments.","","This associated function returns whether or not a set of …","The arguments of the builtin. These will be typechecked …","The arguments of the builtin. These will be typechecked …","Try to get this constant expression as a boolean value.","Try to get this constant expression as a float.","Try to get this constant expression as an integer.","Try to get this constant expression as a symbol (like in …","Cast an expression as another type.","Cast an expression as another type.","Perform an AssignOp on this expression.","Perform an AssignOp on this expression.","BitwiseAnd this expression with another.","BitwiseOr this expression with another.","BitwiseAnd this expression with another.","BitwiseAnd this expression with another.","","BitwiseOr this expression with another.","","Bitwise this expression with another.","The list of assembly instructions to be pasted into the …","The list of assembly instructions to be pasted into the …","Construct a new pattern which matches a constant boolean.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Checks if the operation can be applied to the given types.","Checks if the operation can be applied to the given type.","Checks if the operation can be applied to the given types.","Checks if the operation can be applied to the given types.","","","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this binary operation be applied to the given types?","Can this binary operation be applied to the given types?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Can this unary operation be applied to the given type?","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Checks if the operation can be applied to the given …","Can this type be cast to another type?","Can a pointer of this mutability decay to a pointer of …","Can this type decay into another type?","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Clones the operation into a boxed trait object.","Clones the operation into a boxed trait object.","Clones the operation into a boxed trait object.","Clones the operation into a boxed trait object.","","","","Clone this operation into a trait object.","Clone this binary operation into a box.","Clone this binary operation into a box.","Clone this binary operation into a box.","","Clone this binary operation into a box.","Clone this binary operation into a box.","","Clone this operation into a box.","Clone this operation into a box.","Clone this binary operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","Clone this operation into a box.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Compile the expression into an assembly program.","Compile the expression into an assembly program.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expression.","Compiles the operation on the given expression.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compiles the operation on the given expressions.","Compile the assignment operation.","","","","","","","","Compiles the operation on the given types. (Generates the …","Compiles the operation on the given type. (Generates the …","Compiles the operation on the given types. (Generates the …","Compiles the operation on the given types. (Generates the …","","","Compile the binary operation.","Compile the assignment operation.","Compile the binary operation.","Compile the binary operation.","Compile the binary operation.","","Compile the binary operation.","Compile the binary operation.","Compile the binary operation.","Compile the unary operation.","Compile the unary operation.","Compile the binary operation.","Compile the binary operation.","Compile the unary operation.","Compile the unary operation.","Compile the unary operation.","Compile the unary operation.","Compile the unary operation.","Does this type contain a symbol with the given name? This …","","Let-bind the pattern to the given expression. This will …","","","Define multiple types with the given names under this …","Define a variable in the current scope. This will …","Dereference this expression (i.e. get the value it points …","Dereference this expression (i.e. get the value it points …","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","Formats the operation for display.","","Divide this expression by another.","","","","","","","","","Is this expression greater than another?","","","","","","","","","","","","","","","","","","","","","","","","","Are two types structurally equal?","","","","","","","","","","","","","","","","","","","","","","","","","","","Evaluates the operation on the given constant expressions.","Evaluates the operation on the given constant expression.","Evaluates the operation on the given constant expressions.","Evaluates the operation on the given constant expressions.","Evaluate this constant expression at compile time, and get …","","","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this binary operation on the given constant …","Evaluate this binary operation on the given constant …","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Evaluate this unary operation on the given constant values.","Get a field from a structure, union, or tuple.","Get a field from a structure, union, or tuple.","Construct a new pattern which matches a constant float.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Returns the argument unchanged.","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Is this expression greater than or equal to another?","","Get the arguments of the procedure.","","Get the map of new variables and their types which are …","Get the body of the procedure.","Get the type of a branch with a given expression matched …","Get the name of the procedure known to the LIR front-end.","Get the mangled name of the procedure. The procedure’s …","","","Get the name of this polymorphic procedure. This is not …","Get the return type of the procedure.","Get the first argument’s mutability (if it is a pointer)","Get the size of something in memory (number of cells).","Get the size of something in memory (number of cells).","Get the size of something in memory, but limit the number …","","","","","","","","","","Get the type associated with a value under a given …","Get the type associated with a value under a given …","Get the type of a value under a given environment and check","","","","","","","","Get the type of an associated constant of a type.","Is this expression greater than another?","","Does this type have an element type matching the supplied …","Does this annotation have a location?","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Index an array or pointer with an expression that …","Generate an if letexpression, which matches a given expr, …","Create an if-then-else statement with this expression as …","Construct a new pattern which matches a constant integer.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Is this type an irreducible, atomic type?","Is this compiler-generated?","","Is this data protected against mutation?","Is this dead code?","Is this pattern exhaustive?","Is this annotation a location?","","","Can this data be accessed mutably?","Is this annotation none?","","","","Is first argument of function a reference?","Is this type in a simple form? A simple form is a form …","Is this a temporary?","Is this expression less than or equal to another?","Create a let-bound type.","Create a let binding for a constant expression.","Create several const bindings at onces.","Create a proc binding for a procedure.","Create several proc bindings at onces.","Create a let binding for an type.","Create several type bindings at onces.","Create a let binding for an expression.","Create a let binding for an expression, and define …","Get the location of this annotation.","Is this expression less than another?","Generate an expression which evaluates a match expression, …","","Take some type arguments and produce a monomorphized …","Multiply this expression by another.","The name of the builtin. This isn’t used in compilation, …","The name of the builtin. This isn’t used in compilation, …","Get the remainder of this expression divided by another.","Is this expression greater than or equal to another?","Create a new assignment operation.","Create a new FFI procedure.","Construct a new procedure with a given list of arguments …","Construct a new polymorphic procedure with type …","Logical not this expression.","Logical or this expression with another.","","","","","","","","","","","","","","","","","","","","","","","Perform type applications if possible.","Construct a new pattern which matches a pointer.","Get the power of this expression to another.","Construct a procedure.","Push this procedure’s label to the stack.","Reference this expression (i.e. get a pointer to it).","Get the remainder of this expression divided by another.","The return value the builtin will leave on the stack after …","The return value the builtin will leave on the stack after …","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expression.","Gets the type of the operation on the given expression.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","Gets the type of the operation on the given expressions.","","","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this binary …","Get the type of the result of applying this binary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","Get the type of the result of applying this unary …","This is just for debugging purposes. This sets the common …","Simplify an expression while maintaining structural …","Simplify an expression while maintaining structural …","","","","Simplify until the type is concrete.","Simplify a type until you can get its members.","Simplify a type until you can get its variants.","Simplify an expression until it matches a given function …","Simplify until the type is a polymorphic type.","","Simplify until the type passes the type checker.","Simplify a type until it’s a union.","Get the size of an expression.","","Construct a new pattern which matches a struct with a …","Create a structure of fields to expressions.","Subtract an expression from this expression.","Substitute a type for a given name in the environment.","","Substitute a type in a given expression.","","","","","","Substitute all occurences of a symbol with another type. …","","","Construct a new pattern which matches a symbol with a …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Construct a new pattern which matches a tuple of patterns.","Type check the expression.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expression.","Typechecks the operation on the given expression.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","Typechecks the operation on the given expressions.","","","","Type-check a pattern match of an expression against this …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Apply a unary operation to this expression.","Evaluate a variable in the current scope.","Calculate the integral value of a variant in an enum.","Create a while statement with this expression as the …","Construct a new pattern which matches any expression.","Return this expression, but with a given declaration in …","Return this expression, but with a given declaration in …","","","","","","","","","A struct representing a location in the source code. This …","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","Parse Core and Standard variants of assembly source code. …","Parse frontend sage code into an LIR expression.","Parse LIR code as an LIR expression.","Parse Core and Standard variants of virtual machine source …","","","","","","","","This is an FFI binding, which is used to call a foreign …","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","Create a new FFI binding.","","","","","","","","Input from an accelerometer (in meters per second per …","Input from altitude sensor (in meters)","Electrical device input modes (These should typically be …","Electrical device output modes Set the voltage of a given …","The different axes an input or output might use.","Input from a barometer (pressure in atmospheres)","Ring a bell (in hertz)","Black","Set the pressure of a given blower (in atmospheres)","Blue","Blue light intensity (in lux)","Input from a light sensor (in lux)","Lighting device output modes Set the brightness of a given …","Input from a button (0=not pressed, 1=pressed)","Sound output modes Ring a given buzzer (in hertz)","The channel to use for a given I/O mode.","Clear the display","Physical sensor input modes (These should typically be …","The different output colors a program might use.","Input from a compass (degrees)","Input from a conductivity sensor (in siemens per meter)","Turn a cooler on or off (0=off, 1=on)","Custom output modes A custom input mode (for use with a …","Custom output modes A custom output mode (for use with a …","Cyan","User input modes (These should typically be used for games …","Input from depth sensor (in meters)","Input from a digital input (0=low, 1=high)","Set the state of a given digital output (0=low, 1=high)","The different directions a D-Pad a might use.","","Set the pressure of a given fan (in atmospheres)","Input from a flow sensor (in liters per second)","Green","Green light intensity (in lux)","Input from a gyroscope (in degrees per second) around a …","Turn a heater on or off (0=off, 1=on)","Input from a humidity sensor (in percent)","An input source for a program.","The different types of input modes a program might use.","Input from a JoyStick the degree of displacement in a …","Input from keyboard (ASCII character)","","Magenta","Input from a magnetometer (in teslas) in a given axis","Input from a microphone (frequency in hertz)","Set the speed of a given motor (in revolutions per minute)","Move the cursor down on the display","Move the cursor left on the display","Move the cursor right on the display","Move the cursor up on the display","Play a given note (in hertz)","Input from an odometer (in meters)","Orange","An output destination for a program.","The different types of output modes a program might use.","Input from a pH sensor (in pH)","Input from a position sensor in a given axis (x, y, z)","Set the pressure of a given vacuum/pressurizer …","Engineering / Science sensor input modes Input from a …","Alternative output modes for standard output Printer …","Printer (float)","Printer (integer)","Input from a distance sensor (in meters)","Set the pressure of a given pump (in atmospheres)","RGB ","Input from a rain gauge (in millimeters)","Special input modes A random number","Red","Environment sensor input modes (These should typically be …","","Set the position of a given servo (in radians)","Write a character to the display","Set the cursor column on the display","Set the color of a given pixel on the display","Set the cursor row on the display","Set the polarity of a solenoid (0=off, 1=on)","Set the frequency of a given speaker (in hertz)","Set the volume of a given speaker (in percent)","Navigation input modes (These should typically be …","Standard error (ASCII character)","Standard error (float)","Standard error (integer)","Standard input modes (The standard interface is typically …","Standard input (float)","Standard input (integer)","Standard output modes Standard output (ASCII character)","Standard output (float)","Standard output (integer)","Robotics device output modes Set the position of a given …","Set the temperature of a given heating/cooling device …","Input from a thermometer (degrees K)","Input from a UV sensor (in watts per square meter)","","Display output modes Update the display","Set the position of a given valve (0=closed, 1=open)","Input from a volume sensor (in liters)","Input from a weight sensor (in kilograms)","White","Input from a wind direction sensor (in degrees)","Input from a wind speed sensor (in meters per second)","","","Yellow","","","","","","","","","","","","","","","","","","The channel to use for the input.","The channel to use for the output.","The time (in seconds) since the program started","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","The mode of the input.","The mode of the output.","Create a new input source.","Create a new output destination.","","","","","","","","","A random number","Output to STDERR (ASCII character)","Output to STDERR (float)","Output to STDERR (integer)","Input from STDIN (ASCII character)","Input from STDIN (float)","Input from STDIN (integer)","Output to STDOUT (ASCII character)","Output to STDOUT (float)","Output to STDOUT (integer)","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A trait for a target architecture to be compiled to.","Implement a compiler for the given target.","Compile the core variant of the machine code (must be …","","Compile the standard variant of the machine code (should …","","C Target","Compile the declaration of a procedure.","Compile an End instruction (with the matching If or While …","Get a value from the given input stream (mode + channel).","The string used for indentation.","The name of the target architecture.","Compile a CoreOp instruction.","Peek a value from the device connected to the program.","Poke a value to the device connected to the program.","The code after the function definitions.","The code after the program ends.","The code after each instruction.","The code before the function definitions.","The code before the program starts.","Put a value to the given output stream (mode + channel).","C Target","Compile a StandardOp instruction.","Whether or not the target architecture supports floating …","Whether or not the target architecture supports the given …","Whether or not the target architecture supports the given …","The version of the target architecture.","x86 Target","The type for the C target which implements the Target …","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","The type for the C target which implements the Target …","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","The type for the x86 target which implements the Target …","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","Store the inverse-cosine of the register (as a float) into …","Store the inverse-sine of the register (as a float) into …","Store the inverse-tangent of the register (as a float) …","Add the value pointed to on the tape to the register.","Add the value pointed to on the tape to the register (as …","Take the value of the register, and allocate that number …","Perform bitwise nand on the cell and the value pointed to …","Calls the nth function defined in the program, where n is …","Call a foreign function interface function.","A comment in the machine code (not in the compiled output).","The interpreter which runs the virtual machine program.","An individual core virtual machine instruction.","Execute a core instruction.","A program of only core virtual machine instructions.","Store the cosine of the register (as a float) into the …","The pointer is made equal to the value pointed to on the …","Create an input / output device for the virtual machine …","Divide the register by the value pointed to on the tape.","Divide the register by the value pointed to on the tape …","Begin an “else” conditional.","End a conditional.","An error generated by the virtual machine.","When the virtual machine attempts to get the program as …","Free the memory pointed to by the register.","Create a new function.","Get a value from an input source and store it in the …","Begin an “if the register is not zero” conditional.","Interpret the register’s value as a pointer to a cell. …","Make the register equal to 1 if the register is …","Make the register equal to the integer 1 if the register …","Move the pointer on the tape by a number of cells.","Multiply the register by the value pointed to on the tape.","Multiply the register by the value pointed to on the tape …","Get a value from the input interface / device and store it …","Write the value of the register to the output interface / …","Store the value of the register (as a float) to the power …","Write the value of the register to an output source.","The last “deref” operation is undone; the pointer is …","Store the remainder of the register and the value pointed …","Store the remainder of the register and the value pointed …","Store the value pointed to on the tape to the register.","Return from the current function.","Store the register to the value pointed to on the tape.","Set the register equal to a constant value.","Set the register equal to a constant floating point value.","Store the sine of the register (as a float) into the …","A device used for standard input and output. This simply …","The interpreter which runs the standard variant of virtual …","An individual standard virtual machine instruction.","A program of core and standard virtual machine …","Subtract the value pointed to on the tape from the …","Subtract the value pointed to on the tape from the …","Store the tangent of the register (as a float) into the …","A device used for testing the compiler. This simply keeps …","Convert the register from an integer to a float.","Convert the register from a float to an integer.","When an instruction is unsupported for a given …","An interface to conveniently create virtual machine …","Store the value of the pointer to the register.","Begin a “while the register is not zero” loop.","","A function to reinterpret the bits of an integer as a …","A function to reinterpret the bits of a float as an …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","FFI call to the device. This will get the FFI binding for …","","","","","Flatten a core program so that all of its functions are …","Flatten a core program so that all of its functions are …","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Get the next input (from a given input source).","","","","Get the code for each function.","Get the code for each function.","Get the code outside of any functions.","Get the code outside of any functions.","Get the code outside of any functions, and the code for …","Get the code outside of any functions, and the code for …","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","Create a new testing device with some given sample input.","","","","","","Get the output of the testing device as a string (ascii).","","","","","","","Peek at the next value in the FFI buffer for the FFI …","","","","Poke a value into the FFI buffer for the FFI function …","","","","Put the given value to the given output destination.","","","","","","","Run a core program using this interpreter and its device.","Run a core program using this interpreter and its device.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,71,0,71,1,1,1,1,1,71,0,1,71,0,71,71,1,0,71,1,1,1,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,15,15,8,15,8,15,8,15,8,15,8,15,15,15,15,8,15,8,15,15,8,8,15,8,15,15,8,15,8,15,15,15,15,8,8,8,8,15,15,8,15,8,15,8,15,8,15,8,96,97,98,99,100,101,102,103,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,96,97,98,99,100,101,102,116,117,118,119,120,121,122,106,122,105,123,115,123,115,104,105,106,107,108,109,110,111,112,113,114,123,116,117,118,119,120,121,116,0,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,0,21,0,0,0,0,0,0,0,21,21,0,21,0,0,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,9,9,9,9,24,24,9,24,9,24,9,24,9,24,24,24,24,9,24,24,9,9,24,24,9,24,24,9,24,24,24,24,9,24,24,9,24,9,24,9,24,9,24,9,124,125,124,125,126,127,128,129,130,131,124,125,126,127,128,129,130,131,0,0,42,33,0,32,31,26,0,60,30,26,30,32,32,0,31,26,30,31,26,32,0,0,26,0,26,0,0,0,0,0,0,31,30,34,34,31,30,31,30,0,0,32,34,27,0,26,33,34,0,31,32,34,0,34,52,0,31,26,0,26,26,32,52,42,30,31,26,30,0,50,0,0,27,0,31,31,30,0,0,0,50,50,26,26,60,27,26,31,30,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,34,50,50,30,34,34,27,26,26,31,26,32,32,32,31,42,0,60,26,0,32,30,0,32,32,32,34,31,30,0,50,31,31,0,0,33,30,30,31,27,0,42,31,27,30,0,0,32,32,26,42,26,30,0,31,32,31,0,31,27,31,26,33,30,42,31,33,30,32,34,0,31,34,0,26,31,26,33,30,0,31,27,30,0,32,31,32,34,0,26,31,26,30,30,32,32,32,27,27,33,32,26,26,33,27,26,27,29,30,33,26,32,31,26,31,26,30,33,61,62,31,31,31,31,31,26,26,26,26,26,26,26,34,26,34,26,61,62,33,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,38,38,66,66,67,67,68,68,30,60,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,34,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,60,132,132,38,38,66,66,67,67,68,68,40,43,132,31,26,61,62,63,64,38,66,67,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,30,52,33,29,60,29,29,26,26,38,38,66,66,67,67,68,68,52,26,38,66,67,68,34,31,27,26,26,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,33,61,62,63,64,65,60,30,30,34,31,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,33,61,62,63,64,65,60,30,38,66,67,68,31,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,31,26,33,34,29,29,32,32,31,31,27,27,26,26,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,33,33,61,61,62,62,63,63,64,64,65,65,60,60,30,30,34,34,29,32,32,31,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,26,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,60,30,65,26,29,64,29,33,64,33,64,64,26,30,65,64,30,133,133,133,31,26,61,62,63,64,65,30,30,134,134,134,31,26,61,62,63,64,65,29,26,29,30,34,34,31,27,26,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,33,61,62,63,64,65,60,30,26,33,26,33,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,30,34,30,60,34,33,34,26,30,60,34,30,30,30,30,30,34,26,30,26,26,26,26,26,26,26,26,34,26,33,31,65,26,61,62,26,26,43,63,64,65,26,26,38,66,67,68,34,40,41,44,45,46,47,48,49,50,51,52,53,56,57,58,59,60,30,33,26,31,64,26,26,61,62,38,38,66,66,67,67,68,68,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,64,135,135,31,30,30,30,30,30,30,30,30,30,30,26,30,33,26,26,134,31,26,61,62,63,64,65,30,134,134,33,31,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,26,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,33,136,38,38,66,66,67,67,68,68,31,27,26,33,61,62,63,64,65,30,34,29,32,31,27,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,33,61,62,63,64,65,60,30,26,26,30,26,33,31,26,137,138,137,138,139,137,138,139,0,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,0,0,0,0,72,72,72,72,72,0,0,0,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,82,82,82,83,0,82,83,81,83,81,82,82,83,82,83,0,83,82,0,82,82,83,82,83,81,82,82,82,83,0,80,83,82,81,82,82,83,82,0,0,82,82,80,81,82,82,83,83,83,83,83,83,82,81,0,0,82,82,83,82,83,83,83,82,83,81,82,82,81,82,80,83,83,83,83,83,83,83,83,82,83,83,83,82,82,82,83,83,83,83,83,82,82,80,83,83,82,82,81,82,82,79,79,81,79,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,78,20,78,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,79,80,80,81,81,82,82,83,83,84,84,78,78,20,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,78,20,78,20,79,80,81,82,83,84,78,20,78,20,20,20,78,78,78,20,20,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,79,80,81,82,83,84,78,20,0,0,140,140,140,140,0,141,141,141,141,141,141,141,141,141,141,141,141,141,141,0,141,141,141,141,141,0,0,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,0,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,0,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,86,86,86,85,86,86,85,85,86,85,0,0,86,0,86,85,0,85,86,85,85,0,7,86,85,85,85,85,85,86,85,85,86,86,86,86,85,85,85,86,85,85,85,85,86,86,0,0,0,0,85,86,86,0,86,86,7,0,85,85,91,0,0,142,142,142,142,142,92,93,16,85,25,86,94,91,7,92,93,16,85,25,86,94,91,7,142,16,85,25,86,91,7,16,85,25,86,91,7,16,85,142,16,25,142,92,93,16,25,94,91,142,142,16,85,25,86,7,16,85,94,95,142,94,91,94,16,25,16,85,85,25,86,86,94,91,7,7,92,93,16,85,25,25,86,94,91,7,95,142,94,91,16,25,16,25,16,25,16,85,142,94,92,93,16,85,25,86,94,91,7,142,142,92,93,94,94,142,16,25,94,94,94,16,85,25,86,7,95,142,94,91,95,142,94,91,95,142,94,91,142,142,142,92,93,142,142,142,16,25,16,85,25,86,91,7,16,85,25,86,7,92,93,16,85,25,86,94,91,7,92,93,16,85,25,86,94,91,7,92,93,16,85,25,86,94,91,7,142],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[1,1],[[]],[2],0,[[],3],[[1,1],4],[[1,5],6],[[1,5],6],[7,1],[[]],[3,[[11,[[10,[8,9]]]]]],0,[[]],[12,4],0,[[12,12,3]],[8],[[1,1],[[11,[13]]]],0,[9,[[10,[1]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[15,3],[[10,[16,1]]]],[[]],[[]],[[]],[[]],[15,15],[8,8],[[]],[[]],[[15,15],13],[[8,8],13],0,[15,3],[[],15],[[15,15],4],[[8,8],4],[[],4],[[],4],[[15,5],6],[[15,5],6],[[8,5],6],[[8,5],6],[[]],[[]],[[15,3],[[11,[[10,[8,9]]]]]],[[15,17]],[[8,17]],[[]],[[]],[[15,12],4],[[[18,[8]]],15],[[15,8]],[[15,15],[[11,[13]]]],[[8,8],[[11,[13]]]],[19,8],[[19,20],8],[[21,19],8],[[15,9],[[10,[1]]]],[[]],[[]],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[22,2,3],21],[[]],[[]],[22,22],[[]],[[],22],[[22,5],6],[[22,5],6],[[]],[[22,12],11],[[22,12],[[11,[21]]]],[[22,12],[[11,[3]]]],[22,3],[[]],[[],22],[[22,21],[[10,[21,1]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[21,21],[[]],[[21,21],13],[21,21],[[21,21],4],[[],4],[[21,5],6],[[21,5],6],[[]],[[21,17]],[[]],[[21,23],21],[[21,21],[[11,[13]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[24,3],[[10,[25,1]]]],[[]],[[]],[[]],[[]],[24,24],[9,9],[[]],[[]],0,[24,3],[[],24],[[24,24],4],[[9,9],4],[[24,5],6],[[24,5],6],[[9,5],6],[[9,5],6],[[]],[15,24],[[]],[[24,3],[[11,[[10,[8,9]]]]]],[[]],[[]],[[24,12],4],[[[18,[9]]],24],[[24,8]],[[24,24],[[11,[13]]]],[[9,9],[[11,[13]]]],[[24,9],[[10,[1]]]],[[]],[[]],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[19,[11,[12]]],[[10,[26,2]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[27,[28,[27]]]],[[26,[28,[26]]],26],[[27,[28,[27]]]],[[29,30,19,31],[[10,[32]]]],[[30,29],[[10,[32]]]],[[[18,[33]]],33],[[26,[28,[26]]],26],[[32,34],32],[[31,34],31],[[26,[28,[34]]],26],[[31,[18,[26]]],26],[[26,[18,[26]]],26],[[30,[18,[30]]],30],[[26,[35,[33]],30,29],[[10,[4,32]]]],0,0,[[31,29],[[10,[4,32]]]],[[31,29],[[10,[36,32]]]],[[31,29],[[10,[37,32]]]],[[31,29],[[10,[2,32]]]],[[31,30],31],[[26,30],26],[[26,[39,[38]],[28,[26]]],26],[[26,38,[28,[26]]],26],[[26,[28,[26]]],26],[[26,[28,[26]]],26],[[26,[28,[26]]],26],[26,26],[[34,34]],[[26,[28,[26]]],26],[[34,34]],[[26,[28,[26]]],26],0,0,[4,33],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[30,30,29],[[10,[4,32]]]],[[30,29],[[10,[4,32]]]],[[30,30,29],[[10,[4,32]]]],[[30,30,30,29],[[10,[4,32]]]],[[40,30,30,29],[[10,[4,32]]]],[[41,30,29],[[10,[4,32]]]],[[42,30,30,29],[[10,[4,32]]]],[[43,30,30,29],[[10,[4,32]]]],[[44,30,30,29],[[10,[4,32]]]],[[45,30,30,29],[[10,[4,32]]]],[[46,30,30,29],[[10,[4,32]]]],[[47,30,29],[[10,[4,32]]]],[[48,30,30,29],[[10,[4,32]]]],[[49,30,30,29],[[10,[4,32]]]],[[50,30,30,29],[[10,[4,32]]]],[[51,30,29],[[10,[4,32]]]],[[52,30,29],[[10,[4,32]]]],[[53,30,30,29],[[10,[4,32]]]],[[54,30,30,29],[[10,[4,32]]]],[[55,30,29],[[10,[4,32]]]],[[56,30,29],[[10,[4,32]]]],[[57,30,29],[[10,[4,32]]]],[[58,30,29],[[10,[4,32]]]],[[59,30,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,29],[[10,[4,32]]]],[[26,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,26,29],[[10,[4,32]]]],[[26,26,26,29],[[10,[4,32]]]],[[26,26,26,29],[[10,[4,32]]]],[[30,30,29],[[10,[4,32]]]],[[60,60],4],[[30,30,29],[[10,[4,32]]]],[34,34],[29,29],[32,32],[31,31],[27,27],[26,26],[40,40],[41,41],[42,42],[43,43],[44,44],[45,45],[46,46],[47,47],[48,48],[49,49],[50,50],[51,51],[52,52],[53,53],[54,54],[55,55],[56,56],[57,57],[58,58],[59,59],[33,33],[61,61],[62,62],[63,63],[64,64],[65,65],[60,60],[30,30],[[],[[39,[38]]]],[[],[[39,[66]]]],[[],[[39,[67]]]],[[],[[39,[68]]]],[40,[[39,[67]]]],[41,[[39,[66]]]],[42,[[39,[67]]]],[43,[[39,[38]]]],[44,[[39,[67]]]],[45,[[39,[67]]]],[46,[[39,[67]]]],[47,[[39,[66]]]],[48,[[39,[67]]]],[49,[[39,[67]]]],[50,[[39,[67]]]],[51,[[39,[66]]]],[52,[[39,[66]]]],[53,[[39,[67]]]],[54,[[39,[67]]]],[55,[[39,[66]]]],[56,[[39,[66]]]],[57,[[39,[66]]]],[58,[[39,[66]]]],[59,[[39,[66]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[38,38],13],[[66,66],13],[[67,67],13],[[68,68],13],[[34,34],13],[[40,40],13],[[41,41],13],[[44,44],13],[[45,45],13],[[46,46],13],[[47,47],13],[[48,48],13],[[49,49],13],[[50,50],13],[[51,51],13],[[52,52],13],[[53,53],13],[[56,56],13],[[57,57],13],[[58,58],13],[[59,59],13],[[60,60],13],[[[0,[69,70]]],[[10,[[10,[15,24]],32]]]],[[[0,[69,70]]],[[10,[[10,[15,24]],32]]]],[[26,26,29,71],[[10,[32]]]],[[26,26,29,71],[[10,[32]]]],[[26,29,71],[[10,[32]]]],[[26,29,71],[[10,[32]]]],[[26,26,29,71],[[10,[32]]]],[[26,26,29,71],[[10,[32]]]],[[26,26,26,29,71],[[10,[32]]]],[[26,26,26,29,71],[[10,[32]]]],[[40,26,26,29,71],[[10,[32]]]],[[43,26,26,29,71],[[10,[32]]]],[[29,71],[[10,[32]]]],[[31,29,71],[[10,[32]]]],[[26,29,71],[[10,[32]]]],[[61,29,71],[[10,[32]]]],[[62,29,71],[[10,[32]]]],[[63,29,71],[[10,[32]]]],[[64,29,71],[[10,[32]]]],[[30,30,29,71],[[10,[32]]]],[[30,29,71],[[10,[32]]]],[[30,30,29,71],[[10,[32]]]],[[30,30,30,29,71],[[10,[32]]]],[[40,30,30,29,71],[[10,[32]]]],[[41,30,29,71],[[10,[32]]]],[[42,30,30,29,71],[[10,[32]]]],[[43,30,30,29,71],[[10,[32]]]],[[44,30,30,29,71],[[10,[32]]]],[[45,30,30,29,71],[[10,[32]]]],[[46,30,30,29,71],[[10,[32]]]],[[47,30,29,71],[[10,[32]]]],[[48,30,30,29,71],[[10,[32]]]],[[49,30,30,29,71],[[10,[32]]]],[[50,30,30,29,71],[[10,[32]]]],[[51,30,29,71],[[10,[32]]]],[[52,30,29,71],[[10,[32]]]],[[53,30,30,29,71],[[10,[32]]]],[[54,30,30,29,71],[[10,[32]]]],[[55,30,29,71],[[10,[32]]]],[[56,30,29,71],[[10,[32]]]],[[57,30,29,71],[[10,[32]]]],[[58,30,29,71],[[10,[32]]]],[[59,30,29,71],[[10,[32]]]],[[30,12],4],[[21,30,29,71],[[10,[32]]]],[[33,26,30,29],[[10,[32]]]],[[],29],[[],60],[[29,18]],[[29,19,60,30],[[10,[23,32]]]],[26,26],[[26,[28,[26]]],26],[[26,26],2],[[26,26],2],[26,2],[26,2],[[26,26],2],[[26,26],2],[[26,26,26],2],[[26,26,26],2],[[21,30,29,71],[[10,[32]]]],[[26,[28,[26]]],26],[[38,38],4],[[66,66],4],[[67,67],4],[[68,68],4],[[34,34],4],[[31,31],4],[[27,27],4],[[26,26],4],[[26,[28,[26]]],26],[[40,40],4],[[41,41],4],[[44,44],4],[[45,45],4],[[46,46],4],[[47,47],4],[[48,48],4],[[49,49],4],[[50,50],4],[[51,51],4],[[52,52],4],[[53,53],4],[[56,56],4],[[57,57],4],[[58,58],4],[[59,59],4],[[33,33],4],[[61,61],4],[[62,62],4],[[63,63],4],[[64,64],4],[[65,65],4],[[60,60],4],[[30,30],4],[[30,30,29],[[10,[4,32]]]],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[31,31,29],[[10,[31,32]]]],[[31,29],[[10,[31,32]]]],[[31,31,29],[[10,[31,32]]]],[[31,31,31,29],[[10,[31,32]]]],[[31,29],[[10,[31,32]]]],[[40,31,31,29],[[10,[31,32]]]],[[41,31,29],[[10,[31,32]]]],[[42,31,31,29],[[10,[31,32]]]],[[43,31,31,29],[[10,[31,32]]]],[[44,31,31,29],[[10,[31,32]]]],[[45,31,31,29],[[10,[31,32]]]],[[46,31,31,29],[[10,[31,32]]]],[[47,31,29],[[10,[31,32]]]],[[48,31,31,29],[[10,[31,32]]]],[[49,31,31,29],[[10,[31,32]]]],[[50,31,31,29],[[10,[31,32]]]],[[51,31,29],[[10,[31,32]]]],[[52,31,29],[[10,[31,32]]]],[[53,31,31,29],[[10,[31,32]]]],[[54,31,31,29],[[10,[31,32]]]],[[55,31,29],[[10,[31,32]]]],[[56,31,29],[[10,[31,32]]]],[[57,31,29],[[10,[31,32]]]],[[58,31,29],[[10,[31,32]]]],[[59,31,29],[[10,[31,32]]]],[[31,31],31],[[26,31],26],[36,33],[[34,5],6],[[29,5],6],[[29,5],6],[[32,5],6],[[32,5],6],[[31,5],6],[[31,5],6],[[27,5],6],[[27,5],6],[[26,5],6],[[26,5],6],[[40,5],6],[[40,5],6],[[41,5],6],[[41,5],6],[[42,5],6],[[42,5],6],[[43,5],6],[[43,5],6],[[44,5],6],[[44,5],6],[[45,5],6],[[45,5],6],[[46,5],6],[[46,5],6],[[47,5],6],[[47,5],6],[[48,5],6],[[48,5],6],[[49,5],6],[[49,5],6],[[50,5],6],[[50,5],6],[[51,5],6],[[51,5],6],[[52,5],6],[[52,5],6],[[53,5],6],[[53,5],6],[[54,5],6],[[54,5],6],[[55,5],6],[[55,5],6],[[56,5],6],[[56,5],6],[[57,5],6],[[57,5],6],[[58,5],6],[[58,5],6],[[59,5],6],[[59,5],6],[[33,5],6],[[33,5],6],[[61,5],6],[[61,5],6],[[62,5],6],[[62,5],6],[[63,5],6],[[63,5],6],[[64,5],6],[[64,5],6],[[65,5],6],[[65,5],6],[[60,5],6],[[60,5],6],[[30,5],6],[[30,5],6],[[]],[72,34],[[]],[1,32],[[]],[[]],[[[39,[27]]],27],[73,27],[[],27],[[],27],[[],27],[[],27],[[],27],[[]],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[[18,[[28,[27]]]]],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[[],27],[31,26],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[4,60],[[]],[[64,[18,[2]]],65],[[26,[28,[26]]],26],[[29,30],18],[64,35],[[29,30,12],11],[[33,26,30,29],[[10,[[74,[2]],32]]]],[64,26],[[33,26,26,29],[[10,[30,32]]]],[64,[[11,[12]]]],[64,12],[[26,29],[[10,[[11,[60]],32]]]],[[30,30,[74,[2,30]],[75,[2]],29],[[10,[32]]]],[65,12],[64,30],[[30,29],[[11,[60]]]],[29,[[10,[3,32]]]],[29,[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[29,3],[[10,[3,32]]]],[[30,29,3],[[10,[3,32]]]],[[30,29],[[18,[2]]]],[29,[[10,[30,32]]]],[29,[[10,[30,32]]]],[[29,3],[[10,[30,32]]]],[[31,29,3],[[10,[30,32]]]],[[26,29,3],[[10,[30,32]]]],[[61,29,3],[[10,[30,32]]]],[[62,29,3],[[10,[30,32]]]],[[63,29,3],[[10,[30,32]]]],[[64,29,3],[[10,[30,32]]]],[[65,29,3],[[10,[30,32]]]],[[29,30,12],[[11,[30]]]],[[26,[28,[26]]],26],[[29,30,12],4],[[30,30,29],[[10,[4,32]]]],[34,4],[[34,17]],[[31,17]],[[27,17]],[[26,17]],[[40,17]],[[41,17]],[[44,17]],[[45,17]],[[46,17]],[[47,17]],[[48,17]],[[49,17]],[[50,17]],[[51,17]],[[52,17]],[[53,17]],[[56,17]],[[57,17]],[[58,17]],[[59,17]],[[33,17]],[[61,17]],[[62,17]],[[63,17]],[[64,17]],[[65,17]],[[60,17]],[[30,17]],[[26,[28,[26]]],26],[[33,26,26,26,29],[[10,[26,32]]]],[[26,[28,[26]],[28,[26]]],26],[37,33],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[30,4],[34,4],[30,4],[60,4],[34,4],[[33,26,30,29],[[10,[4,32]]]],[34,4],[[26,29],[[10,[4,32]]]],[[30,30,29],[[10,[4,32]]]],[60,4],[34,4],[30,4],[[30,29],[[10,[4,32]]]],[[30,[75,[2]],29],[[10,[4,32]]]],[[30,29],[[10,[4,32]]]],[30,4],[34,4],[[26,[28,[26]]],26],[[12,30,30],30],[[19,31,[28,[26]]],26],[[18,[28,[26]]],26],[[19,64,[28,[26]]],26],[[[73,[12,64]],[28,[26]]],26],[[19,30,[28,[26]]],26],[[18,[28,[26]]],26],[[19,[28,[60]],[11,[30]],[28,[26]],[28,[26]]],26],[[18,[28,[26]]],26],[34,[[11,[72]]]],[[26,[28,[26]]],26],[[26,35,29],[[10,[26,32]]]],[[31,[18,[30]]],31],[[65,[18,[30]],29],[[10,[64,32]]]],[[26,[28,[26]]],26],0,0,[26,26],[[26,[28,[26]]],26],[67,43],[[2,[18,[30]],30],63],[[[11,[2]],18,30,[28,[26]]],64],[[2,[18,[2]],18,30,[28,[26]]],65],[26,26],[[26,[28,[26]]],26],[[38,38],[[11,[13]]]],[[66,66],[[11,[13]]]],[[67,67],[[11,[13]]]],[[68,68],[[11,[13]]]],[[34,34],[[11,[13]]]],[[40,40],[[11,[13]]]],[[41,41],[[11,[13]]]],[[44,44],[[11,[13]]]],[[45,45],[[11,[13]]]],[[46,46],[[11,[13]]]],[[47,47],[[11,[13]]]],[[48,48],[[11,[13]]]],[[49,49],[[11,[13]]]],[[50,50],[[11,[13]]]],[[51,51],[[11,[13]]]],[[52,52],[[11,[13]]]],[[53,53],[[11,[13]]]],[[56,56],[[11,[13]]]],[[57,57],[[11,[13]]]],[[58,58],[[11,[13]]]],[[59,59],[[11,[13]]]],[[60,60],[[11,[13]]]],[[30,29,[74,[30]]],[[10,[30,32]]]],[33,33],[[26,[28,[26]]],26],[[[11,[2]],18,30,[28,[26]]],31],[[64,71]],[[26,[28,[60]]],26],[[26,[28,[26]]],26],0,0,[[26,26,29],[[10,[30,32]]]],[[26,26,29],[[10,[30,32]]]],[[26,29],[[10,[30,32]]]],[[26,29],[[10,[30,32]]]],[[26,26,29],[[10,[30,32]]]],[[26,26,29],[[10,[30,32]]]],[[26,26,26,29],[[10,[30,32]]]],[[26,26,26,29],[[10,[30,32]]]],[[40,26,26,29],[[10,[30,32]]]],[[41,26,29],[[10,[30,32]]]],[[42,26,26,29],[[10,[30,32]]]],[[43,26,26,29],[[10,[30,32]]]],[[44,26,26,29],[[10,[30,32]]]],[[45,26,26,29],[[10,[30,32]]]],[[46,26,26,29],[[10,[30,32]]]],[[47,26,29],[[10,[30,32]]]],[[48,26,26,29],[[10,[30,32]]]],[[49,26,26,29],[[10,[30,32]]]],[[50,26,26,29],[[10,[30,32]]]],[[51,26,29],[[10,[30,32]]]],[[52,26,29],[[10,[30,32]]]],[[53,26,26,29],[[10,[30,32]]]],[[54,26,26,29],[[10,[30,32]]]],[[55,26,29],[[10,[30,32]]]],[[56,26,29],[[10,[30,32]]]],[[57,26,29],[[10,[30,32]]]],[[58,26,29],[[10,[30,32]]]],[[59,26,29],[[10,[30,32]]]],[[64,19]],[29,[[10,[32]]]],[[29,3],[[10,[32]]]],[[31,29,3],[[10,[31,32]]]],[[30,29,3],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29,30,76],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[[30,29],[[10,[30,32]]]],[26,26],[[30,29],30],[[[73,[2,33]]],33],[[[73,[12,26]]],26],[[26,[28,[26]]],26],[[12,30]],[[31,12,30]],[[26,12,30]],[[61,12,30]],[[62,12,30]],[[63,12,30]],[[64,12,30]],[[65,12,30]],[[30,12,30],30],[[[35,[2]],[35,[30]]]],[[[35,[2]],[35,[30]]]],[[[28,[60]],19],33],[[31,[18,[2]]],31],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[26,29],[[10,[26,32]]]],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[[18,[33]]],33],[29,[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,29],[[10,[32]]]],[[26,29],[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,26,29],[[10,[32]]]],[[26,26,26,29],[[10,[32]]]],[[26,26,26,29],[[10,[32]]]],[[31,29],[[10,[32]]]],[[27,29],[[10,[32]]]],[[26,29],[[10,[32]]]],[[33,26,26,29],[[10,[32]]]],[[61,29],[[10,[32]]]],[[62,29],[[10,[32]]]],[[63,29],[[10,[32]]]],[[64,29],[[10,[32]]]],[[65,29],[[10,[32]]]],[[30,29],[[10,[32]]]],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[26,66],26],[19,26],[[[35,[2]],2],[[11,[3]]]],[[26,[28,[26]]],26],[[],33],[[31,[28,[27]]],31],[[26,[28,[27]]],26],0,0,0,0,0,0,0,0,0,[[]],[[]],[72,72],[[]],[[72,72],13],0,[[72,72],4],[[],4],0,[[72,5],6],[[]],[[72,12],2],[[72,17]],[[]],0,0,0,[19,[[10,[[10,[15,24]],2]]]],[[19,[11,[12]]],[[10,[26,2]]]],[19,[[10,[26,2]]]],[19,[[10,[[10,[16,25]],2]]]],[[72,72],[[11,[13]]]],[[]],[[],10],[[],10],[[],14],0,0,0,[[]],[[]],[77,77],[[]],[[77,77],13],[[77,77],4],[[],4],[[77,5],6],[[77,5],6],[[]],[[77,17]],0,[[]],0,[[2,3,3],77],0,[[77,77],[[11,[13]]]],[[]],[[],2],[[],10],[[],10],[[],14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[],78],[79,79],[80,80],[81,81],[82,82],[83,83],[84,84],[78,78],[20,20],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[79,79],13],[[80,80],13],[[81,81],13],[[82,82],13],[[83,83],13],[[84,84],13],[[78,78],13],[[20,20],13],[[79,79],4],[[80,80],4],[[81,81],4],[[82,82],4],[[83,83],4],[[84,84],4],[[78,78],4],[[20,20],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[79,5],6],[[79,5],6],[[80,5],6],[[80,5],6],[[81,5],6],[[81,5],6],[[82,5],6],[[82,5],6],[[83,5],6],[[83,5],6],[[84,5],6],[[84,5],6],[[78,5],6],[[78,5],6],[[20,5],6],[[20,5],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[79,17]],[[80,17]],[[81,17]],[[82,17]],[[83,17]],[[84,17]],[[78,17]],[[20,17]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[82,3],78],[[83,3],20],[[79,79],[[11,[13]]]],[[80,80],[[11,[13]]]],[[81,81],[[11,[13]]]],[[82,82],[[11,[13]]]],[[83,83],[[11,[13]]]],[[84,84],[[11,[13]]]],[[78,78],[[11,[13]]]],[[20,20],[[11,[13]]]],[[],78],[[],20],[[],20],[[],20],[[],78],[[],78],[[],78],[[],20],[[],20],[[],20],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],0,0,[16,[[10,[2,2]]]],[[85,[18,[85]],[18,[3]],3,3],[[10,[2,2]]]],[25,[[10,[2,2]]]],[[86,[18,[85]],[18,[3]],3,3],[[10,[2,2]]]],0,[3,2],[[85,[11,[3]]],2],[78,[[10,[2,2]]]],[[],[[11,[2]]]],[[],12],[85,2],[[],[[10,[2,2]]]],[[],[[10,[2,2]]]],[[[18,[87]]],[[11,[2]]]],[4,[[11,[2]]]],[[],[[11,[2]]]],[[[18,[87]]],[[11,[2]]]],[4,[[11,[2]]]],[20,[[10,[2,2]]]],0,[86,[[10,[2,2]]]],[[],4],[78,4],[20,4],[[],12],0,0,[[]],[[]],[[88,3],2],[[],88],[[88,85,[11,[3]]],2],[[]],[[88,78],[[10,[2,2]]]],[[]],[88,12],[[88,85],2],[88,[[10,[2,2]]]],[88,[[10,[2,2]]]],[[88,[18,[87]]],[[11,[2]]]],[[88,4],[[11,[2]]]],[88,[[11,[2]]]],[[88,4],[[11,[2]]]],[[88,20],[[10,[2,2]]]],[[88,86],[[10,[2,2]]]],[88,4],[[88,78],4],[[88,20],4],[[],10],[[],10],[[],14],[88,12],0,[[]],[[]],[[89,3],2],[[],89],[[89,85,[11,[3]]],2],[[]],[[89,78],[[10,[2,2]]]],[[]],[89,12],[[89,85],2],[89,[[10,[2,2]]]],[89,[[10,[2,2]]]],[[89,[18,[87]]],[[11,[2]]]],[[89,4],[[11,[2]]]],[89,[[11,[2]]]],[[89,4],[[11,[2]]]],[[89,20],[[10,[2,2]]]],[[89,86],[[10,[2,2]]]],[89,4],[[89,78],4],[[89,20],4],[[],10],[[],10],[[],14],[89,12],0,[[]],[[]],[[90,3],2],[[],90],[[90,85,[11,[3]]],2],[[]],[[90,78],[[10,[2,2]]]],[[]],[90,12],[[90,85],2],[90,[[10,[2,2]]]],[90,[[10,[2,2]]]],[[90,[18,[87]]],[[11,[2]]]],[[90,4],[[11,[2]]]],[90,[[11,[2]]]],[[90,4],[[11,[2]]]],[[90,20],[[10,[2,2]]]],[[90,86],[[10,[2,2]]]],[90,4],[[90,78],4],[[90,20],4],[[],10],[[],10],[[],14],[90,12],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[91,77]],[37,36],[36,37],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[16,16],[85,85],[25,25],[86,86],[91,91],[7,7],[[]],[[]],[[]],[[]],[[]],[[]],[[16,16],13],[[85,85],13],[[],[[10,[16,25]]]],[16,[[10,[16,25]]]],[25,[[10,[16,25]]]],[12],[[],[[92,[91]]]],[[],[[93,[91]]]],[[],16],[[],25],[[],94],[[],91],[[]],[[]],[[16,16],4],[[85,85],4],[[25,25],4],[[86,86],4],[[7,7],4],[[],4],[[],4],0,[[77,[11,[[18,[37]]]]],[[10,[2]]]],[77,[[10,[7]]]],[[94,77,[11,[[18,[37]]]]],[[10,[2]]]],[[91,77,[11,[[18,[37]]]]],[[10,[2]]]],0,[16,16],[25,25],[[16,5],6],[[85,5],6],[[85,5],6],[[25,5],6],[[86,5],6],[[86,5],6],[[94,5],6],[[91,5],6],[[7,5],6],[[7,5],6],[[]],[[]],[[]],[[]],[[]],[16,25],[[]],[[]],[[]],[[]],[78,[[10,[37,2]]]],[78],[[94,78],[[10,[37,2]]]],[[91,78],[[10,[37,2]]]],[16,[[74,[87,[18,[85]]]]]],[25,[[74,[87,[18,[86]]]]]],[16,[[18,[85]]]],[25,[[18,[86]]]],[16],[25],[[16,17]],[[85,17]],[[]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[23],[95,[[92,[95]]]],[95,[[93,[95]]]],[19,94],[[[18,[37]]],94],[85],[[16,85]],[[25,85]],0,[94,2],[94,[[18,[37]]]],[[16,16],[[11,[13]]]],[[85,85],[[11,[13]]]],[[25,25],[[11,[13]]]],[[86,86],[[11,[13]]]],[[7,7],[[11,[13]]]],[[],[[10,[37,2]]]],[[],[[10,[7]]]],[94,[[10,[37,2]]]],[91,[[10,[37,2]]]],[37,[[10,[2]]]],[[],[[10,[7]]]],[[94,37],[[10,[2]]]],[[91,37],[[10,[2]]]],[[37,20],[[10,[2]]]],[20],[[94,37,20],[[10,[2]]]],[[91,37,20],[[10,[2]]]],[[]],[[]],[[]],[[[92,[95]],16],[[10,[95,2]]]],[[[93,[95]],25],[[10,[95,2]]]],[[]],[37],[86,[[10,[7]]]],[[16,86],[[10,[7]]]],[[25,86],[[10,[7]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[],2],[[],2],[[],2],[[],2],[[],2],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[]]],"c":[],"p":[[4,"Error"],[3,"String"],[15,"usize"],[15,"bool"],[3,"Formatter"],[6,"Result"],[4,"Error"],[4,"CoreOp"],[4,"StandardOp"],[4,"Result"],[4,"Option"],[15,"str"],[4,"Ordering"],[3,"TypeId"],[3,"CoreProgram"],[3,"CoreProgram"],[8,"Hasher"],[3,"Vec"],[8,"ToString"],[3,"Output"],[4,"Location"],[3,"Globals"],[15,"isize"],[3,"StandardProgram"],[3,"StandardProgram"],[4,"Expr"],[4,"Declaration"],[8,"Into"],[3,"Env"],[4,"Type"],[4,"ConstExpr"],[4,"Error"],[4,"Pattern"],[4,"Annotation"],[15,"slice"],[15,"f64"],[15,"i64"],[8,"AssignOp"],[3,"Box"],[3,"Add"],[3,"Negate"],[4,"Arithmetic"],[3,"Assign"],[3,"BitwiseAnd"],[3,"BitwiseNand"],[3,"BitwiseNor"],[3,"BitwiseNot"],[3,"BitwiseOr"],[3,"BitwiseXor"],[4,"Comparison"],[3,"Get"],[4,"Put"],[3,"And"],[3,"Or"],[3,"Not"],[3,"New"],[3,"Delete"],[3,"Tag"],[3,"Data"],[4,"Mutability"],[3,"CoreBuiltin"],[3,"StandardBuiltin"],[3,"FFIProcedure"],[3,"Procedure"],[3,"PolyProcedure"],[8,"UnaryOp"],[8,"BinaryOp"],[8,"TernaryOp"],[8,"Sized"],[8,"Clone"],[8,"AssemblyProgram"],[3,"SourceCodeLocation"],[3,"BTreeMap"],[3,"HashMap"],[3,"HashSet"],[8,"Fn"],[3,"FFIBinding"],[3,"Input"],[4,"Axis"],[4,"Direction"],[4,"Color"],[4,"InputMode"],[4,"OutputMode"],[3,"Channel"],[4,"CoreOp"],[4,"StandardOp"],[15,"i32"],[3,"C"],[3,"SageOS"],[3,"X86"],[3,"StandardDevice"],[3,"CoreInterpreter"],[3,"StandardInterpreter"],[3,"TestingDevice"],[8,"Device"],[13,"Compare"],[13,"IsGreater"],[13,"IsGreaterEqual"],[13,"IsLess"],[13,"IsLessEqual"],[13,"IsEqual"],[13,"IsNotEqual"],[13,"GetAddress"],[13,"Move"],[13,"Copy"],[13,"Index"],[13,"Add"],[13,"Sub"],[13,"Mul"],[13,"Div"],[13,"Rem"],[13,"DivRem"],[13,"And"],[13,"Or"],[13,"PopFrom"],[13,"Array"],[13,"BitwiseNand"],[13,"BitwiseXor"],[13,"BitwiseOr"],[13,"BitwiseNor"],[13,"BitwiseAnd"],[13,"Global"],[13,"PushTo"],[13,"IsGreater"],[13,"IsLess"],[13,"Pow"],[13,"Add"],[13,"Sub"],[13,"Mul"],[13,"Div"],[13,"Rem"],[8,"Compile"],[8,"GetSize"],[8,"GetType"],[8,"Simplify"],[8,"TypeCheck"],[13,"MismatchedTypes"],[13,"MismatchedMutability"],[13,"NonExhaustivePatterns"],[8,"CompiledTarget"],[8,"Architecture"],[8,"VirtualMachineProgram"]]}\ }'); if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/docs/source-files.js b/docs/source-files.js index 0f3dd53d..0447b8c4 100644 --- a/docs/source-files.js +++ b/docs/source-files.js @@ -1,4 +1,4 @@ var sourcesIndex = JSON.parse('{\ -"sage":["",[["asm",[],["core.rs","globals.rs","location.rs","mod.rs","std.rs"]],["frontend",[],["mod.rs","parse.rs"]],["lir",[["expr",[["ops",[["arithmetic",[],["addition.rs","mod.rs","negate.rs"]],["bitwise",[],["and.rs","mod.rs","nand.rs","nor.rs","not.rs","or.rs","xor.rs"]]],["assign.rs","comparison.rs","io.rs","logic.rs","memory.rs","mod.rs","tagged_union.rs"]],["procedure",[],["builtin.rs","ffi.rs","mod.rs","mono.rs","poly.rs"]]],["const_expr.rs","declaration.rs","expression.rs","mod.rs","pattern.rs"]],["types",[],["check.rs","inference.rs","mod.rs","size.rs"]]],["annotate.rs","compile.rs","env.rs","error.rs","mod.rs"]],["side_effects",[],["ffi.rs","io.rs","mod.rs"]],["targets",[],["c.rs","mod.rs","my_os.rs","x86.rs"]],["vm",[["interpreter",[],["core.rs","mod.rs","std.rs"]]],["core.rs","mod.rs","std.rs"]]],["lib.rs","parse.rs"]]\ +"sage":["",[["asm",[],["core.rs","globals.rs","location.rs","mod.rs","std.rs"]],["frontend",[],["mod.rs","parse.rs"]],["lir",[["expr",[["ops",[["arithmetic",[],["addition.rs","mod.rs","negate.rs"]],["bitwise",[],["and.rs","mod.rs","nand.rs","nor.rs","not.rs","or.rs","xor.rs"]]],["assign.rs","comparison.rs","io.rs","logic.rs","memory.rs","mod.rs","tagged_union.rs"]],["procedure",[],["builtin.rs","ffi.rs","mod.rs","mono.rs","poly.rs"]]],["const_expr.rs","declaration.rs","expression.rs","mod.rs","pattern.rs"]],["types",[],["check.rs","inference.rs","mod.rs","size.rs"]]],["annotate.rs","compile.rs","env.rs","error.rs","mod.rs"]],["side_effects",[],["ffi.rs","io.rs","mod.rs"]],["targets",[],["c.rs","mod.rs","sage_os.rs","x86.rs"]],["vm",[["interpreter",[],["core.rs","mod.rs","std.rs"]]],["core.rs","mod.rs","std.rs"]]],["lib.rs","parse.rs"]]\ }'); createSourceSidebar(); diff --git a/docs/src/sage/lib.rs.html b/docs/src/sage/lib.rs.html index fc22e3a0..1cf97ec3 100644 --- a/docs/src/sage/lib.rs.html +++ b/docs/src/sage/lib.rs.html @@ -115,6 +115,8 @@ 115 116 117 +118 +119
//! # The Sage Programming Language
 //!
 //! 🚧 🏗️ ⚠️ This language is under construction! ⚠️ 🏗️ 🚧
@@ -131,8 +133,10 @@
 //!                    ░░░░░░            
 //! ```
 //!
+//! ![Logo](https://github.com/adam-mcdaniel/sage/blob/main/assets/sage.png)
+//! 
 //! <embed type="text/html" src="web/index.html" title="Compiler" width="100%" height="940em"></embed>
-//! ***(The sage compiler itself can be compiled to web assembly to be executed on the web. This allows a sage compiler + interpreter to be hosted on a static web page and run embded sage scripts. This web implementation compiles sage LIR code into sage virtual machine code, and then feeds it to a builtin virtual machine interpreter. The compiler can also switch to various backends, such as the C source code generator, or assembly output.)***
+//! ***(The sage compiler itself can be compiled to web assembly to be executed on the web. This allows a sage compiler + interpreter to be hosted on a static web page and run embedded sage scripts. This web implementation compiles sage LIR code into sage virtual machine code, and then feeds it to a builtin virtual machine interpreter. The compiler can also switch to various backends, such as the C source code generator, or assembly output.)***
 //!
 //! This crate implements a compiler for the sage programming language
 //! and its low level virtual machine.
diff --git a/docs/src/sage/targets/mod.rs.html b/docs/src/sage/targets/mod.rs.html
index 722c3d29..f6c3090b 100644
--- a/docs/src/sage/targets/mod.rs.html
+++ b/docs/src/sage/targets/mod.rs.html
@@ -351,8 +351,8 @@
 pub mod c;
 pub use c::*;
 
-pub mod my_os;
-pub use my_os::*;
+pub mod sage_os;
+pub use sage_os::*;
 
 pub mod x86;
 pub use x86::*;
diff --git a/docs/src/sage/targets/my_os.rs.html b/docs/src/sage/targets/sage_os.rs.html
similarity index 94%
rename from docs/src/sage/targets/my_os.rs.html
rename to docs/src/sage/targets/sage_os.rs.html
index 051e6ed3..a02fb866 100644
--- a/docs/src/sage/targets/my_os.rs.html
+++ b/docs/src/sage/targets/sage_os.rs.html
@@ -1,4 +1,4 @@
-my_os.rs - source
1
+sage_os.rs - source
1
 2
 3
 4
@@ -1002,9 +1002,9 @@
 /// The type for the C target which implements the `Target` trait.
 /// This allows the compiler to target the C language.
 #[derive(Default)]
-pub struct MyOS;
+pub struct SageOS;
 
-impl Architecture for MyOS {
+impl Architecture for SageOS {
     fn supports_input(&self, i: &Input) -> bool {
         matches!(
             i.mode,
@@ -1049,7 +1049,7 @@
             CoreOp::Div => "reg.i /= ptr->i;".to_string(),
             CoreOp::Rem => "reg.i %= ptr->i;".to_string(),
             CoreOp::IsNonNegative => "reg.i = reg.i >= 0;".to_string(),
-            _ => unreachable!("Invalid op for MyOS target {op:?}"),
+            _ => unreachable!("Invalid op for SageOS target {op:?}"),
         }
     }
 
@@ -1076,7 +1076,7 @@
             StandardOp::IsNonNegative => "reg.i = reg.f >= 0;".to_string(),
             StandardOp::Alloc => "reg.p = (cell*)salloc(reg.i * sizeof(reg));".to_string(),
             StandardOp::Free => "sfree((void*)reg.p);".to_string(),
-            _ => return Err(format!("Invalid standard op for MyOS target {op:?}")),
+            _ => return Err(format!("Invalid standard op for SageOS target {op:?}")),
         })
     }
 
@@ -1953,5 +1953,5 @@
     }
 }
 
-impl CompiledTarget for MyOS {}
+impl CompiledTarget for SageOS {}
 
\ No newline at end of file diff --git a/examples/frontend/interactive-calculator.sg b/examples/frontend/interactive-calculator.sg new file mode 100644 index 00000000..596b8480 --- /dev/null +++ b/examples/frontend/interactive-calculator.sg @@ -0,0 +1,440 @@ +enum Expr { + Add (&Expr, &Expr), + Sub (&Expr, &Expr), + Mul (&Expr, &Expr), + Div (&Expr, &Expr), + Rem (&Expr, &Expr), + Num Float, + Group &Expr, +} + +struct Input { + start: &Char, + loc: Int, + length: Int +} + +enum ParseResult { + Ok (Input, &Expr), + Err Int +} + +def is_ok(result: ParseResult): Bool = match result { + of Ok _ => True, + of Err _ => False +}; + +def putint(n: Int) { + if (n < 0) { + print('-'); + putint(-n); + } elif (n < 10) { + print(('0' as Int + n) as Char); + } else { + putint(n / 10); + print(('0' as Int + n % 10) as Char); + } +} + +def main() { + print("+ Adam's Calculator\n"); + print("+ Type 'exit' to exit\n"); + let mut is_done = False; + let buf = alloc(sizeof() * 1024) as &mut Char; + + let exit_text = "exit\0"; + let exit_str = &exit_text as &Char; + while !is_done { + let input = read(buf); + + match parse_expr(input) { + of Ok (input, n) => { + print("Input: "); + print_expr(n); + print("\n => "); + print(eval(n)); + print("\n"); + free_expr(n); + }, + of Err n => { + if (is_ok(parse_symbol(input, exit_str))) { + is_done = True; + } elif (input.length > 0) { + print("\nCalculator: error while parsing at character: \n", input.start[n], "\n"); + } else { + print("No input\n"); + } + } + } + } + print("Bye!\n"); +} + + +def eval(expr: &Expr): Float = match *expr { + of Add (lhs, rhs) => eval(lhs) + eval(rhs), + of Sub (lhs, rhs) => eval(lhs) - eval(rhs), + of Mul (lhs, rhs) => eval(lhs) * eval(rhs), + of Div (lhs, rhs) => eval(lhs) / eval(rhs), + of Rem (lhs, rhs) => eval(lhs) % eval(rhs), + of Num n => n, + of Group inner => eval(inner) +}; + +def print_expr(expr: &Expr) { + match *expr { + of Add(lhs, rhs) => { + print_expr(lhs); + print(" + "); + print_expr(rhs); + }, + of Sub(lhs, rhs) => { + print_expr(lhs); + print(" - "); + print_expr(rhs); + }, + of Mul(lhs, rhs) => { + print_expr(lhs); + print(" * "); + print_expr(rhs); + }, + of Div(lhs, rhs) => { + print_expr(lhs); + print(" / "); + print_expr(rhs); + }, + of Rem(lhs, rhs) => { + print_expr(lhs); + print(" % "); + print_expr(rhs); + }, + of Num n => print(n), + of Group expr => { + print("("); + print_expr(expr); + print(")"); + } + } +} + +def free_expr(expr: &Expr) { + match *expr { + of Add (lhs, rhs) + | of Sub (lhs, rhs) + | of Mul (lhs, rhs) + | of Div (lhs, rhs) + | of Rem (lhs, rhs) => { + free_expr(lhs); + free_expr(rhs); + }, + of Group inner => free_expr(inner), + _ => {} + } + del expr; +} + +def free_input(input: Input) { + del input.start; +} + +def is_between_inclusive(ch: Char, start: Char, end: Char): Bool { + let start = start as Int, + end = end as Int, + ch = ch as Int; + + return start <= ch && ch <= end; +} + +def parse_float(mut input: Input): ParseResult { + let save = input; + let mut n = 0.0; + + if (input.loc == input.length) { + return ParseResult of Err (input.loc); + } + + if !(is_between_inclusive(input.start[input.loc], '0', '9')) { + return ParseResult of Err (input.loc); + } + + for (); input.loc < input.length && is_between_inclusive(input.start[input.loc], '0', '9'); input.loc += 1 { + n *= 10; + n += (input.start[input.loc] as Int - '0' as Int) as Int; + } + + if (input.loc < input.length && input.start[input.loc] == '.') { + input.loc += 1; + let mut m = 0.1; + for (); input.loc < input.length && is_between_inclusive(input.start[input.loc], '0', '9'); input.loc += 1 { + n += (input.start[input.loc] as Int - '0' as Int) as Int * m; + m *= 0.1; + } + } + return ParseResult of Ok (input, new Expr of Num n); +} + +def binop( + lhs: &Expr, + mut input: Input, + op: Char, + factor: Input -> ParseResult, + cons: (&Expr, &Expr) -> &Expr): ParseResult { + + input = parse_whitespaces(input); + if (input.loc == input.length) { + return ParseResult of Err (input.loc); + } + + if input.start[input.loc] == op { + input.loc += 1; + input = parse_whitespaces(input); + match factor(input) { + of Ok (input, rhs) => { + return ParseResult of Ok (input, cons(lhs, rhs)); + }, + of Err _ => { + return ParseResult of Err (input.loc); + } + } + } else { + return ParseResult of Err (input.loc); + } +} + +def parse_expr(mut input: Input): ParseResult { + let save = input; + + if (input.loc == input.length) { + return ParseResult of Err (input.loc); + } + + def add_cons(lhs: &Expr, rhs: &Expr): &Expr { + return new Expr of Add(lhs, rhs); + } + def sub_cons(lhs: &Expr, rhs: &Expr): &Expr { + return new Expr of Sub(lhs, rhs); + } + + match parse_term(input) { + of Ok (new_input, mut lhs) => { + input = new_input; + while True { + lhs = match binop(lhs, input, '+', parse_term, add_cons) { + of Ok (new_input, new_lhs) => { + input = new_input; + new_lhs; + }, + of Err _ => match binop(lhs, input, '-', parse_term, sub_cons) { + of Ok (new_input, new_lhs) => { + input = new_input; + new_lhs; + }, + of Err _ => { + return ParseResult of Ok (input, lhs); + } + } + }; + } + return ParseResult of Ok (input, lhs); + }, + of Err _ => {return ParseResult of Err (input.loc);} + } +} + +def parse_term(mut input: Input): ParseResult { + let save = input; + + if (input.loc == input.length) { + return ParseResult of Err (input.loc); + } + + def mul_cons(lhs: &Expr, rhs: &Expr): &Expr { + return new Expr of Mul(lhs, rhs); + } + def div_cons(lhs: &Expr, rhs: &Expr): &Expr { + return new Expr of Div(lhs, rhs); + } + def rem_cons(lhs: &Expr, rhs: &Expr): &Expr { + return new Expr of Rem(lhs, rhs); + } + + match parse_atom(input) { + of Ok (new_input, mut lhs) => { + input = new_input; + while True { + lhs = match binop(lhs, input, '*', parse_atom, mul_cons) { + of Ok (new_input, new_lhs) => { + input = new_input; + new_lhs; + }, + of Err _ => match binop(lhs, input, '/', parse_atom, div_cons) { + of Ok (new_input, new_lhs) => { + input = new_input; + new_lhs; + }, + of Err _ => match binop(lhs, input, '%', parse_atom, rem_cons) { + of Ok (new_input, new_lhs) => { + input = new_input; + new_lhs; + }, + of Err _ => { + return ParseResult of Ok (input, lhs); + } + } + } + }; + } + return ParseResult of Ok (input, lhs); + }, + of Err _ => {return ParseResult of Err (input.loc);} + } +} + +def parse_symbol(mut input: Input, match_string: &Char): ParseResult { + let save = input; + + if (input.loc == input.length) { + return ParseResult of Err (input.loc); + } + + for let mut i = 0; match_string[i] != '\0'; i+=1 { + if (input.loc == input.length || input.start[input.loc] != match_string[i]) { + return ParseResult of Err (input.loc); + } + input.loc += 1; + } + + return ParseResult of Ok (input, new Expr of Num 0.0); +} + +def parse_atom(input: Input): ParseResult { + let save = input; + + if (input.loc == input.length) { + return ParseResult of Err (input.loc); + } + + let result = parse_float(input); + if let of Err _ = result { + return parse_group(input); + } + return result; +} + +def parse_group(mut input: Input): ParseResult { + let save = input; + + if (input.loc == input.length) { + return ParseResult of Err (input.loc); + } + + if (input.start[input.loc] != '(') { + return ParseResult of Err (input.loc); + } + + input.loc += 1; + let input = parse_whitespaces(input); + + return match parse_expr(input) { + of Ok (mut input, expr) => { + input = parse_whitespaces(input); + if (input.start[input.loc] != ')') { + return ParseResult of Err (input.loc); + } + input.loc += 1; + ParseResult of Ok (input, new Expr of Group(expr)); + }, + of Err _ => ParseResult of Err (input.loc) + }; +} + +def parse_whitespaces(mut input: Input): Input { + let save = input; + + if (input.loc == input.length) { + return input; + } + + for (); input.loc < input.length && (input.start[input.loc] == ' ' || input.start[input.loc] == '\r' || input.start[input.loc] == '\n'); input.loc += 1 {} + + return input; +} + +def is_done(input: Input): Bool = input.loc >= input.length; + +def strlen(ch: &Char): Int { + let mut i = 0; + for (); ch[i] != '\0'; i+=1 {} + return i; +} + +def is_ascii(ch: Char): Bool { + return ch as Int < 128; +} + +def getchar(): Char { + let mut ch = '\0'; + + while !(is_ascii(ch)) || ch == '\0' { + input(&mut ch); + } + + return ch; +} + +def readline(ch: &mut Char, len: Int): Int { + let mut i = len; + + let mut c = getchar(); + + for (); c != '\n' && c != '\0'; i+=1 { + ch[i] = c; + c = getchar(); + } + return i; +} + +def read(buf: &mut Char): Input { + print(">>> "); + let len = readline(buf, 0); + buf[len] = '\0'; + + return { + start = buf as &Char, + length = strlen(buf), + loc = 0 + }; +} +def test(): Input { + let buf = alloc(sizeof() * 1024) as &mut Char; + let text = "(4 + 6) * ((8 - 3) / 2) + (9 % 5)"; + for let mut i = 0; text[i] != '\0'; i+=1 { + buf[i] = text[i]; + } + + return { + start = buf as &Char, + length = strlen(buf), + loc = 0 + }; +} + + +def test_main() { + let input = test(); + + match parse_expr(input) { + of Ok (input, n) => { + print_expr(n); + print("\n => "); + print(eval(n)); + print("\n"); + free_expr(n); + }, + of Err n => { + print("\nCalculator: error while parsing at character: \n", input.start[n], "\n"); + } + } +} + +main(); \ No newline at end of file diff --git a/examples/sage-os/presentation.sg b/examples/sage-os/presentation.sg new file mode 100644 index 00000000..b02c3a2e --- /dev/null +++ b/examples/sage-os/presentation.sg @@ -0,0 +1,414 @@ +/* +* Author: Adam McDaniel +* File: presentation.sg +* Created: 2023-12-8 +* Short Desc: This is implements parsing and showing PPM files on Sage OS. +* Long Desc: +* This is a simple PPM parser and viewer. +* It is designed to be used on Sage OS. +* It reads from a list of files and displays them. +*/ + +def malloc(element_count: Int): &mut T { + return alloc(element_count * sizeof()) as &mut T; +} + +type Pixel = (Int, Int, Int, Int); + +struct PPM { + width: Int, + height: Int, + max_color_value: Int, + pixels: &mut Pixel, +} + +impl PPM { + def make(width: Int, height: Int, max_color_value: Int, pixels: &mut Pixel): PPM { + return { + width=width, + height=height, + max_color_value=max_color_value, + pixels=pixels + }; + } + + def parse_ascii(content: &Char, content_size: Int): Result { + type Ret = Result; + // Find the width and height + let mut width: Int = 0; + let mut height: Int = 0; + let mut i: Int = 0; + + // Skip whitespace + while content[i] == ' ' || content[i] == '\n' { + i += 1; + } + // Match against the `P6` magic number + if content[i] != 'P' || content[i+1] != '3' { + println("Magic number: ", content[i], content[i+1]); + return Ret of Err(Error of InvalidMagicNumber); + } + i += 2; + println("Magic number: ", content[0], content[1]); + + // Skip whitespace + while content[i] == ' ' || content[i] == '\n' { + i += 1; + } + + while content[i] != ' ' { + width = width * 10 + content[i] as Int - '0' as Int; + i += 1; + } + println("Width: ", width); + + // Skip whitespace + while content[i] == ' ' || content[i] == '\n' { + i += 1; + } + + while content[i] != '\n' { + height = height * 10 + content[i] as Int - '0' as Int; + i += 1; + } + println("Height: ", height); + // Skip whitespace + while content[i] == ' ' || content[i] == '\n' { + i += 1; + } + + // Find the max color value + let mut max_color_value: Int = 0; + while content[i] != '\n' { + max_color_value = max_color_value * 10 + content[i] as Int - '0' as Int; + i += 1; + } + println("Max color value: ", max_color_value); + + println("Allocating ", width * height, " pixels"); + debug(); + let pixels = malloc(width * height * 2); + println("Allocated ", width * height, " pixels"); + debug(); + + for let mut row=0; row < height && i < content_size; row += 1 { + for let mut col=0; col < width && i < content_size; col += 1 { + // debug(); + // Skip whitespace + // println("Parsing pixel at ", row, ",", col); + // println("content = ", content as &Cell); + // println("content[", i, "] = ", content[i]); + // debug(); + def isdigit(c: Char): Bool { + let c = c as Int; + return c >= '0' as Int && c <= '9' as Int; + } + + while i < content_size && !(isdigit(content[i])) { + i += 1; + } + + let mut r: Int = 0; + while i < content_size && isdigit(content[i]) { + // println("Parsing r = ", content[i]); + // debug(); + r = r * 10 + content[i] as Int - '0' as Int; + i += 1; + } + + // Skip whitespace + while i < content_size && !(isdigit(content[i])) { + // println("Skipping whitespace"); + // debug(); + i += 1; + } + + let mut g: Int = 0; + while i < content_size && isdigit(content[i]) { + // println("Parsing g = ", content[i]); + // debug(); + g = g * 10 + content[i] as Int - '0' as Int; + i += 1; + } + + // Skip whitespace + while i < content_size && !(isdigit(content[i])) { + i += 1; + } + + let mut b: Int = 0; + while i < content_size && isdigit(content[i]) { + // println("Parsing b = ", content[i]); + // debug(); + b = b * 10 + content[i] as Int - '0' as Int; + i += 1; + } + + pixels[row * width + col] = (r * 255 / max_color_value, g * 255 / max_color_value, b * 255 / max_color_value, 255); + } + } + println("Parsed ", i, " bytes"); + + return Ret of Ok(PPM.make(width, height, max_color_value, pixels)); + } + + def parse_binary(content: &Char): Result { + type Ret = Result; + // Match against the `P6` magic number + if content[0] != 'P' || content[1] != '6' { + return Ret of Err(Error of InvalidMagicNumber); + } + println("Magic number: ", content[0], content[1]); + + // Find the width and height + let mut width: Int = 0; + let mut height: Int = 0; + let mut i: Int = 3; + + // Skip whitespace + while content[i] == ' ' || content[i] == '\n' { + i += 1; + } + + while content[i] != ' ' { + width = width * 10 + content[i] as Int - '0' as Int; + i += 1; + } + println("Width: ", width); + + // Skip whitespace + while content[i] == ' ' || content[i] == '\n' { + i += 1; + } + + while content[i] != '\n' { + height = height * 10 + content[i] as Int - '0' as Int; + i += 1; + } + println("Height: ", height); + // Skip whitespace + while content[i] == ' ' || content[i] == '\n' { + i += 1; + } + + // Find the max color value + let mut max_color_value: Int = 0; + while content[i] != '\n' { + max_color_value = max_color_value * 10 + content[i] as Int - '0' as Int; + i += 1; + } + println("Max color value: ", max_color_value); + + let pixels = malloc(width * height); + + for let mut row=height - 1; row >= 0; row -= 1 { + for let mut col=0; col < width; col += 1 { + // Each pixel is a byte of red, green, and blue + let r = content[i] as Int * 255 / max_color_value; + i += 1; + let g = content[i] as Int * 255 / max_color_value; + i += 1; + let b = content[i] as Int * 255 / max_color_value; + i += 1; + pixels[row * width + col] = (r, g, b, 255); + } + } + + return Ret of Ok(PPM.make(width, height, max_color_value, pixels)); + } + + def print(self: &PPM) { + println("PPM: ", self.width, "x", self.height, " max color value: ", self.max_color_value); + // for let mut row=0; row < self.height; row += 1 { + for let mut row=self.height - 1; row >= 0; row -= 1 { + for let mut col=0; col < self.width; col += 1 { + let pixel = self.pixels[row * self.width + col]; + // print("(", pixel.r, ",", pixel.g, ",", pixel.b, ") "); + // Draw the pixel in the terminal with escape codes + let ESC = 27 as Char; + print(ESC, "[48;2;", pixel.0, ";", pixel.1, ";", pixel.2, "m "); + } + println(""); + } + } + + def draw(self: &PPM) { + extern def screen_flush(rect: &(Int, Int, Int, Int)); + extern def screen_draw_rect(pixels: &mut Pixel, rect: &(Int, Int, Int, Int), x_scale: Int, y_scale: Int): Int; + extern def screen_get_dims(): (Int, Int); + let (width, height) = screen_get_dims(); + + let rect = (0, 0, self.width, self.height); + let x_scale = width / self.width; + let y_scale = height / self.height; + + if screen_draw_rect(self.pixels, &rect, x_scale, y_scale) != 0 { + println("Error drawing PPM"); + } + + let flush_rect = (0, 0, width, height); + screen_flush(&flush_rect); + } + + def drop(self: &mut PPM) { + println("Dropping PPM"); + free(self.pixels); + } +} + +enum Error { + InvalidMagicNumber, + InvalidWidth, + InvalidHeight, + InvalidMaxColorValue, + InvalidPixelData, +} + +def remove_comments(content: &mut Char) { + let mut i = 0; + while content[i] != '\0' { + if content[i] == '#' { + while content[i] != '\n' { + content[i] = ' '; + i += 1; + } + } + i += 1; + } + content[i] = '\0'; +} + +enum Result { + Ok(T), + Err(E), +} + +def main() { + + // let mut ppm_ascii = PPM_ASCII; + /* + println("PPM parser and viewer"); + extern def get_file_size(file_name: &Char): Int; + extern def read_file(file_name: &Char, buffer: &mut Char, buffer_size: Int): Int; + let file_name = "test.ppm"; + let file_size = get_file_size(&file_name); + if file_size <= 0 { + println("Error: file not found: ", file_name); + return (); + } else { + println("File size: ", file_size); + } + + let mut ppm_ascii = malloc(file_size); + + let file_size = read_file(&file_name, ppm_ascii, file_size); + println("Read ", file_size, " bytes from file: ", file_name); + + // println("ASCII PPM:\n", ppm_ascii); + remove_comments(ppm_ascii); + // println("ASCII PPM (no comments):\n", ppm_ascii); + + match PPM.parse_ascii(ppm_ascii) { + of Ok(ppm) => { + println("Parsed ASCII PPM:\n", ppm); + ppm.print(); + }, + of Err(err) => { + println("Error parsing ASCII PPM: ", err); + } + } + */ + + + type Event = (Int, Int, Int); + extern def get_keyboard_event(): Event; + + // A presentation app which gets left and right arrow key events + // and cycles through an array of PPMs + // let mut ppm_array = malloc(3); + + let file_names = [ + &"/home/cosc562/test.ppm" as &Char, + &"/home/cosc562/test2.ppm", + &"/home/cosc562/test3.ppm", + ]; + + println("PPM parser and viewer"); + + let mut is_done = False; + let mut redraw = True; + let mut current_ppm = 0; + while !is_done { + let event = get_keyboard_event(); + if event.0 == 1 && event.1 == 105 && event.2 == 0 { + // Left arrow + println(event); + println("Left arrow"); + current_ppm -= 1; + redraw = True; + } elif event.0 == 1 && event.1 == 106 && event.2 == 0 { + // Right arrow + println(event); + println("Right arrow"); + current_ppm += 1; + redraw = True; + } elif event.0 == 1 && event.1 == 16 { + // q + println("Quitting"); + is_done = True; + } elif event.0 != 0 || event.1 != 0 || event.2 != 0 { + println("Unknown event: ", event); + } + current_ppm %= sizeof(file_names) / sizeof<&Char>(); + if current_ppm < 0 { + current_ppm = sizeof(file_names) / sizeof<&Char>() - 1; + } + + if redraw { + // Draw the current PPM + // ppm_array[current_ppm].draw(); + + extern def get_file_size(file_name: &Char): Int; + extern def read_file(file_name: &Char, buffer: &mut Char, buffer_size: Int): Int; + // let file_name = "test2.ppm"; + let file_name = file_names[current_ppm]; + // let file_name = "/home/cosc562/test2.ppm"; + let file_size = get_file_size(file_name); + + if file_size <= 0 { + println("Error: file not found: ", file_name); + return (); + } else { + println("File size: ", file_size); + } + + println("Allocating ", file_size, " cells"); + // debug(); + let mut ppm_ascii = malloc(file_size * 2); + // debug(); + let file_size = read_file(file_name, ppm_ascii, file_size + 1); + ppm_ascii[file_size] = '\0'; + // debug(); + println("Read ", file_size, " bytes from file: ", file_name); + + // println("ASCII PPM:\n", ppm_ascii); + remove_comments(ppm_ascii); + // println("ASCII PPM (no comments):\n", ppm_ascii); + + if let of Ok(mut ppm) = PPM.parse_ascii(ppm_ascii, file_size) { + println("Drawing PPM"); + // ppm.print(); + ppm.draw(); + ppm.drop(); + } else { + println("Error parsing ASCII PPM"); + return (); + } + free(ppm_ascii); + + redraw = False; + } + } +} + +main(); \ No newline at end of file diff --git a/examples/sage-os/shell.sg b/examples/sage-os/shell.sg new file mode 100644 index 00000000..69f82148 --- /dev/null +++ b/examples/sage-os/shell.sg @@ -0,0 +1,4359 @@ +println("Hello world!\n"); + +const IS_RISCV = True; + + +enum Option { + Some(T), + Nothing +} + +enum Result { + Ok(T), + Err(E) +} + +def panic(): ! { + println("Panic!\n"); + debug(); + while True {} +} + +impl Result { + def is_ok(self: Result): Bool { + match self { + of Ok(_) => True, + _ => False + } + } + + def is_err(self: Result): Bool { + match self { + of Err(_) => True, + _ => False + } + } + + def unwrap(self: Result): T { + match self { + of Ok(x) => x, + _ => { + println("[Error] Called unwrap() on Err value: \n", self); + panic(); + } + } + } + + def unwrap_err(self: Result): E { + match self { + of Err(x) => x, + _ => { + println("[Error] Called unwrap_err() on Ok value: \n", self); + panic(); + } + } + } + + def expect(self: Result, msg: &Char): T { + match self { + of Ok(x) => x, + _ => { + println("[Error] ", msg, "\n"); + println("[Error] Called expect() on Err value: \n", self); + panic(); + } + } + } + + def ok(self: Result): Option { + match self { + of Ok(x) => Option of Some(x), + _ => Option of Nothing + } + } + + def err(self: Result): Option { + match self { + of Err(x) => Option of Some(x), + _ => Option of Nothing + } + } + + def unwrap_or(self: Result, default: T): T { + match self { + of Ok(x) => x, + _ => default + } + } + + def map(self: Result, f: T -> U): Result { + match self { + of Ok(x) => Result of Ok(f(x)), + of Err(x) => Result of Err(x), + _ => { + println("[Error] Called map() on Err value: \n", self); + panic(); + } + } + } +} + +const BITMAP_WIDTH = 8; +const BITMAP_HEIGHT = 8; + +struct Bitmap { + pixels: [[Bool * BITMAP_WIDTH] * BITMAP_HEIGHT] +} + +const __ = False; +const XX = True; + +impl Bitmap { + const WIDTH = BITMAP_WIDTH; + const HEIGHT = BITMAP_HEIGHT; + + const SPACE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const TOP_LEFT_CORNER = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, XX, XX, XX], + [__, __, __, XX, XX, XX, XX, XX], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + ] + }; + + const TOP_RIGHT_CORNER = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [XX, XX, XX, XX, XX, __, __, __], + [XX, XX, XX, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + ] + }; + + const BOTTOM_LEFT_CORNER = { + pixels = [ + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, XX, XX, XX], + [__, __, __, XX, XX, XX, XX, XX], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const BOTTOM_RIGHT_CORNER = { + pixels = [ + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [XX, XX, XX, XX, XX, __, __, __], + [XX, XX, XX, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + + const ERROR = { + pixels = [ + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, __, __, __, __, XX, XX], + [XX, __, XX, __, __, XX, __, XX], + [XX, __, __, XX, XX, __, __, XX], + [XX, __, __, XX, XX, __, __, XX], + [XX, __, XX, __, __, XX, __, XX], + [XX, XX, __, __, __, __, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX], + ] + }; + + const UPPER_A = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_B = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_C = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_D = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_E = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_F = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_G = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, XX, XX, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_H = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_I = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_J = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, XX, __, __, __, XX, __, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_K = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, XX, __, __], + [__, XX, __, __, XX, __, __, __], + [__, XX, __, XX, __, __, __, __], + [__, XX, XX, __, __, __, __, __], + [__, XX, __, XX, __, __, __, __], + [__, XX, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_L = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_M = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, __, __, XX, XX, __], + [__, XX, __, XX, XX, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_N = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, __, __, __, XX, __], + [__, XX, __, XX, __, __, XX, __], + [__, XX, __, __, XX, __, XX, __], + [__, XX, __, __, __, XX, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_O = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_P = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_Q = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, XX, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, XX, __, __] + ] + }; + + const UPPER_R = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, XX, __, __, __, __], + [__, XX, __, __, XX, __, __, __], + [__, __, __, __, __, XX, __, __] + ] + }; + + const UPPER_S = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, XX, __], + [__, __, __, __, __, __, XX, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_T = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_U = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_V = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_W = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, XX, XX, __, XX, __], + [__, XX, XX, __, __, XX, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_X = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_Y = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const UPPER_Z = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const LOWER_A = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const LOWER_B = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const LOWER_C = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + + const LOWER_D = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const LOWER_E = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const LOWER_F = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, XX, XX, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + const LOWER_G = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + ] + }; + + const LOWER_H = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_I = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_J = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, XX, XX, __, __, __, __], + ] + }; + + const LOWER_K = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, XX, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_L = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_M = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, __, XX, __, __], + [__, __, XX, __, XX, __, XX, __], + [__, __, XX, __, XX, __, XX, __], + [__, __, XX, __, XX, __, XX, __], + [__, __, XX, __, XX, __, XX, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_N = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_O = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_P = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + ] + }; + + const LOWER_Q = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + ] + }; + + const LOWER_R = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, __, XX, XX, __, __], + [__, __, XX, XX, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_S = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_T = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const LOWER_U = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_V = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_W = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, __, XX, __], + [__, __, XX, __, __, __, XX, __], + [__, __, XX, __, XX, __, XX, __], + [__, __, XX, __, XX, __, XX, __], + [__, __, __, XX, __, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const LOWER_X = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, __, XX, __], + [__, __, __, XX, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, XX, __, __], + [__, __, XX, __, __, __, XX, __], + ] + }; + + const LOWER_Y = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + ] + }; + + const LOWER_Z = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_0 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, XX, XX, __], + [__, XX, __, __, XX, __, XX, __], + [__, XX, __, XX, __, __, XX, __], + [__, XX, XX, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __] + ] + }; + + const NUM_1 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_2 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_3 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_4 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, XX, __, __, __], + [__, XX, __, __, XX, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_5 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_6 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_7 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, XX, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_8 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const NUM_9 = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, XX, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, XX, __], + [__, __, XX, XX, XX, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_EXCLAMATION = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + ] + }; + + const PUNC_QUOTE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, __, XX, XX, __, __], + [__, XX, XX, __, XX, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_HASH = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, XX, __, __, XX, __, __], + [__, __, XX, __, __, XX, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_DOLLAR = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, XX, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, XX, __, XX, __, __], + [__, XX, XX, XX, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + ] + }; + + const PUNC_PERCENT = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, XX, __, __, __, XX, __], + [__, XX, XX, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, __, __, XX, XX, __], + [__, XX, __, __, __, XX, XX, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_AMPERSAND = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, __, __, __, __], + [__, XX, __, __, XX, __, __, __], + [__, XX, __, __, XX, __, __, __], + [__, __, XX, XX, __, __, XX, __], + [__, XX, __, XX, __, XX, __, __], + [__, XX, __, __, XX, __, __, __], + [__, __, XX, XX, __, XX, __, __], + ] + }; + + const PUNC_APOSTROPHE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_LEFT_PAREN = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, XX, __, __, __], + ] + }; + + + const PUNC_RIGHT_PAREN = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + ] + }; + + const PUNC_ASTERISK = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, XX, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_ADD = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_COMMA = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, XX, XX, __, __, __, __, __], + [__, XX, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + ] + }; + + const PUNC_DASH = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_PERIOD = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, XX, XX, __, __, __, __, __], + [__, XX, XX, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + const PUNC_FORWARD_SLASH = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, XX, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_COLON = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_SEMICOLON = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, XX, __, __, __], + ] + }; + + const PUNC_LESS_THAN = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, XX, __, __], + ] + }; + + const PUNC_EQUALS = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, __, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, XX, XX, XX, XX, XX, XX, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_GREATER_THAN = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, XX, __, __, __, __, __], + ] + }; + + const PUNC_QUESTION = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, XX, __, __], + [__, XX, __, __, __, __, XX, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + ] + }; + + const PUNC_AT = { + pixels = [ + [__, XX, XX, XX, XX, XX, XX, __], + [XX, __, __, __, __, __, __, XX], + [XX, __, __, XX, XX, __, __, XX], + [XX, __, __, __, __, XX, __, XX], + [XX, __, __, XX, XX, XX, __, XX], + [XX, __, XX, __, __, XX, __, XX], + [XX, __, __, XX, XX, XX, __, XX], + [__, XX, XX, XX, XX, XX, XX, __] + ] + }; + + const PUNC_LEFT_SQUARE_BRACE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, XX, XX, __, __, __], + ] + }; + + const PUNC_BACK_SLASH = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, __, XX, __], + [__, __, __, __, __, __, __, __], + ] + }; + const PUNC_RIGHT_SQUARE_BRACE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, XX, XX, XX, __, __], + ] + }; + const PUNC_CARET = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, XX, __, __, __], + [__, __, __, XX, __, XX, __, __], + [__, __, XX, __, __, __, XX, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_UNDERSCORE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [XX, XX, XX, XX, XX, XX, XX, XX], + ] + }; + + const PUNC_BACKTICK = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const PUNC_LEFT_CURLY_BRACE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, XX, __, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, XX, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + ] + }; + + const PUNC_PIPE = { + pixels = [ + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + [__, __, __, XX, __, __, __, __], + ] + }; + + const PUNC_RIGHT_CULRY_BRACE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, XX, XX, __, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, __, XX, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, XX, XX, __, __, __], + ] + }; + + const PUNC_TILDE = { + pixels = [ + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + [__, __, XX, XX, __, __, __, __], + [__, XX, XX, XX, XX, __, XX, __], + [__, XX, __, __, XX, XX, XX, __], + [__, __, __, __, __, XX, __, __], + [__, __, __, __, __, __, __, __], + [__, __, __, __, __, __, __, __], + ] + }; + + const SOLID_BLOCK = { + pixels = [ + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX], + [XX, XX, XX, XX, XX, XX, XX, XX] + ] + }; + + const SPARSE_BLOCK = { + pixels = [ + [XX, __, XX, __, XX, __, XX, __], + [__, XX, __, XX, __, XX, __, XX], + [XX, __, XX, __, XX, __, XX, __], + [__, XX, __, XX, __, XX, __, XX], + [XX, __, XX, __, XX, __, XX, __], + [__, XX, __, XX, __, XX, __, XX], + [XX, __, XX, __, XX, __, XX, __], + [__, XX, __, XX, __, XX, __, XX], + ] + }; + + const UPPER_ALPHABET = [ + Bitmap.UPPER_A, + Bitmap.UPPER_B, + Bitmap.UPPER_C, + Bitmap.UPPER_D, + Bitmap.UPPER_E, + Bitmap.UPPER_F, + Bitmap.UPPER_G, + Bitmap.UPPER_H, + Bitmap.UPPER_I, + Bitmap.UPPER_J, + Bitmap.UPPER_K, + Bitmap.UPPER_L, + Bitmap.UPPER_M, + Bitmap.UPPER_N, + Bitmap.UPPER_O, + Bitmap.UPPER_P, + Bitmap.UPPER_Q, + Bitmap.UPPER_R, + Bitmap.UPPER_S, + Bitmap.UPPER_T, + Bitmap.UPPER_U, + Bitmap.UPPER_V, + Bitmap.UPPER_W, + Bitmap.UPPER_X, + Bitmap.UPPER_Y, + Bitmap.UPPER_Z + ]; + + const LOWER_ALPHABET = [ + Bitmap.LOWER_A, + Bitmap.LOWER_B, + Bitmap.LOWER_C, + Bitmap.LOWER_D, + Bitmap.LOWER_E, + Bitmap.LOWER_F, + Bitmap.LOWER_G, + Bitmap.LOWER_H, + Bitmap.LOWER_I, + Bitmap.LOWER_J, + Bitmap.LOWER_K, + Bitmap.LOWER_L, + Bitmap.LOWER_M, + Bitmap.LOWER_N, + Bitmap.LOWER_O, + Bitmap.LOWER_P, + Bitmap.LOWER_Q, + Bitmap.LOWER_R, + Bitmap.LOWER_S, + Bitmap.LOWER_T, + Bitmap.LOWER_U, + Bitmap.LOWER_V, + Bitmap.LOWER_W, + Bitmap.LOWER_X, + Bitmap.LOWER_Y, + Bitmap.LOWER_Z + ]; + + const NUMBERS = [ + Bitmap.NUM_0, + Bitmap.NUM_1, + Bitmap.NUM_2, + Bitmap.NUM_3, + Bitmap.NUM_4, + Bitmap.NUM_5, + Bitmap.NUM_6, + Bitmap.NUM_7, + Bitmap.NUM_8, + Bitmap.NUM_9 + ]; + + const PUNCTUATION = [ + Bitmap.PUNC_EXCLAMATION, + Bitmap.PUNC_QUOTE, + Bitmap.PUNC_HASH, + Bitmap.PUNC_DOLLAR, + Bitmap.PUNC_PERCENT, + Bitmap.PUNC_AMPERSAND, + Bitmap.PUNC_APOSTROPHE, + Bitmap.PUNC_LEFT_PAREN, + Bitmap.PUNC_RIGHT_PAREN, + Bitmap.PUNC_ASTERISK, + Bitmap.PUNC_ADD, + Bitmap.PUNC_COMMA, + Bitmap.PUNC_DASH, + Bitmap.PUNC_PERIOD, + Bitmap.PUNC_FORWARD_SLASH, + Bitmap.PUNC_COLON, + Bitmap.PUNC_SEMICOLON, + Bitmap.PUNC_LESS_THAN, + Bitmap.PUNC_EQUALS, + Bitmap.PUNC_GREATER_THAN, + Bitmap.PUNC_QUESTION, + Bitmap.PUNC_AT, + Bitmap.PUNC_LEFT_SQUARE_BRACE, + Bitmap.PUNC_BACK_SLASH, + Bitmap.PUNC_RIGHT_SQUARE_BRACE, + Bitmap.PUNC_CARET, + Bitmap.PUNC_UNDERSCORE, + Bitmap.PUNC_BACKTICK, + Bitmap.PUNC_LEFT_CURLY_BRACE, + Bitmap.PUNC_PIPE, + Bitmap.PUNC_RIGHT_CULRY_BRACE, + Bitmap.PUNC_TILDE + ]; + + def from_char(c: Char): Bitmap { + // let sparse = 2 as Char; + // let static SPARSE_BLOCK_CHAR: Char = sparse; + // let solid = 1 as Char; + // let static SOLID_BLOCK_CHAR: Char = solid; + if c == 2 as Char { + return Bitmap.SPARSE_BLOCK; + } + if c == 1 as Char { + return Bitmap.SOLID_BLOCK; + } + match c { + + 'A' => Bitmap.UPPER_A, + 'B' => Bitmap.UPPER_B, + 'C' => Bitmap.UPPER_C, + 'D' => Bitmap.UPPER_D, + 'E' => Bitmap.UPPER_E, + 'F' => Bitmap.UPPER_F, + 'G' => Bitmap.UPPER_G, + 'H' => Bitmap.UPPER_H, + 'I' => Bitmap.UPPER_I, + 'J' => Bitmap.UPPER_J, + 'K' => Bitmap.UPPER_K, + 'L' => Bitmap.UPPER_L, + 'M' => Bitmap.UPPER_M, + 'N' => Bitmap.UPPER_N, + 'O' => Bitmap.UPPER_O, + 'P' => Bitmap.UPPER_P, + 'Q' => Bitmap.UPPER_Q, + 'R' => Bitmap.UPPER_R, + 'S' => Bitmap.UPPER_S, + 'T' => Bitmap.UPPER_T, + 'U' => Bitmap.UPPER_U, + 'V' => Bitmap.UPPER_V, + 'W' => Bitmap.UPPER_W, + 'X' => Bitmap.UPPER_X, + 'Y' => Bitmap.UPPER_Y, + 'Z' => Bitmap.UPPER_Z, + 'a' => Bitmap.LOWER_A, + 'b' => Bitmap.LOWER_B, + 'c' => Bitmap.LOWER_C, + 'd' => Bitmap.LOWER_D, + 'e' => Bitmap.LOWER_E, + 'f' => Bitmap.LOWER_F, + 'g' => Bitmap.LOWER_G, + 'h' => Bitmap.LOWER_H, + 'i' => Bitmap.LOWER_I, + 'j' => Bitmap.LOWER_J, + 'k' => Bitmap.LOWER_K, + 'l' => Bitmap.LOWER_L, + 'm' => Bitmap.LOWER_M, + 'n' => Bitmap.LOWER_N, + 'o' => Bitmap.LOWER_O, + 'p' => Bitmap.LOWER_P, + 'q' => Bitmap.LOWER_Q, + 'r' => Bitmap.LOWER_R, + 's' => Bitmap.LOWER_S, + 't' => Bitmap.LOWER_T, + 'u' => Bitmap.LOWER_U, + 'v' => Bitmap.LOWER_V, + 'w' => Bitmap.LOWER_W, + 'x' => Bitmap.LOWER_X, + 'y' => Bitmap.LOWER_Y, + 'z' => Bitmap.LOWER_Z, + '0' => Bitmap.NUM_0, + '1' => Bitmap.NUM_1, + '2' => Bitmap.NUM_2, + '3' => Bitmap.NUM_3, + '4' => Bitmap.NUM_4, + '5' => Bitmap.NUM_5, + '6' => Bitmap.NUM_6, + '7' => Bitmap.NUM_7, + '8' => Bitmap.NUM_8, + '9' => Bitmap.NUM_9, + '!' => Bitmap.PUNC_EXCLAMATION, + '"' => Bitmap.PUNC_QUOTE, + '#' => Bitmap.PUNC_HASH, + '$' => Bitmap.PUNC_DOLLAR, + '%' => Bitmap.PUNC_PERCENT, + '&' => Bitmap.PUNC_AMPERSAND, + '\'' => Bitmap.PUNC_APOSTROPHE, + '(' => Bitmap.PUNC_LEFT_PAREN, + ')' => Bitmap.PUNC_RIGHT_PAREN, + '*' => Bitmap.PUNC_ASTERISK, + '+' => Bitmap.PUNC_ADD, + ',' => Bitmap.PUNC_COMMA, + '-' => Bitmap.PUNC_DASH, + '.' => Bitmap.PUNC_PERIOD, + '/' => Bitmap.PUNC_FORWARD_SLASH, + ':' => Bitmap.PUNC_COLON, + ';' => Bitmap.PUNC_SEMICOLON, + '<' => Bitmap.PUNC_LESS_THAN, + '=' => Bitmap.PUNC_EQUALS, + '>' => Bitmap.PUNC_GREATER_THAN, + '?' => Bitmap.PUNC_QUESTION, + '@' => Bitmap.PUNC_AT, + '[' => Bitmap.PUNC_LEFT_SQUARE_BRACE, + '\\' => Bitmap.PUNC_BACK_SLASH, + ']' => Bitmap.PUNC_RIGHT_SQUARE_BRACE, + '^' => Bitmap.PUNC_CARET, + '_' => Bitmap.PUNC_UNDERSCORE, + '`' => Bitmap.PUNC_BACKTICK, + '{' => Bitmap.PUNC_LEFT_CURLY_BRACE, + '|' => Bitmap.PUNC_PIPE, + '}' => Bitmap.PUNC_RIGHT_CULRY_BRACE, + '~' => Bitmap.PUNC_TILDE, + '\n' | ' ' | '\t' | '\0' => Bitmap.SPACE, + _ => Bitmap.ERROR + } + } + + def empty(): Bitmap { + return { pixels = [[False] * BITMAP_WIDTH] * BITMAP_HEIGHT }; + } + + def width(self: &Bitmap): Int { + return BITMAP_WIDTH; + } + + def height(self: &Bitmap): Int { + return BITMAP_HEIGHT; + } + + def print(self: &Bitmap) { + for let mut y=0; y < self.height(); y+=1 { + for let mut x=0; x < self.width(); x+=1 { + if self.pixels[y][x] { + print("*"); + } else { + print(" "); + } + } + print("\n"); + } + } + + def print_bordered(self: &Bitmap) { + print("+"); + for let mut x=0; x < self.width(); x+=1 { + print("-"); + } + println("+"); + + for let mut y=0; y < self.height(); y+=1 { + print("|"); + for let mut x=0; x < self.width(); x+=1 { + if self.pixels[y][x] { + print("*"); + } else { + print(" "); + } + } + println("|"); + } + + print("+"); + for let mut x=0; x < self.width(); x+=1 { + print("-"); + } + println("+"); + } +} + +type Pixel = (Int, Int, Int, Int); + +struct Color { + r: Int, + g: Int, + b: Int, + a: Int +} + +impl Color { + const WHITE = { r = 255, g = 255, b = 255, a = 255 }; + const BLACK = { r = 0, g = 0, b = 0, a = 255 }; + const RED = { r = 255, g = 0, b = 0, a = 255 }; + const GREEN = { r = 0, g = 255, b = 0, a = 255 }; + const BLUE = { r = 0, g = 0, b = 255, a = 255 }; + const YELLOW = { r = 255, g = 255, b = 0, a = 255 }; + const CYAN = { r = 0, g = 255, b = 255, a = 255 }; + const MAGENTA = { r = 255, g = 0, b = 255, a = 255 }; + const TRANSPARENT = { r = 0, g = 0, b = 0, a = 0 }; + + def from_rgb(r: Int, g: Int, b: Int): Color { + return { r = r, g = g, b = b, a = 255 }; + } + + def from_rgb_f(r: Float, g: Float, b: Float): Color { + // println("r = ", r); + // println("g = ", g); + // println("b = ", b); + return { r = (r * 255) as Int, g = (g * 255) as Int, b = (b * 255) as Int, a = 255 }; + } + + def to_pixel(self: Color): Pixel { + return (self.r, self.g, self.b, self.a); + } + + def from_pixel(pixel: Pixel): Color { + return { r = pixel.0, g = pixel.1, b = pixel.2, a = pixel.3 }; + } + + def to_float(self: &Color): (Float, Float, Float) { + return ((self.r as Float) / 255.0, (self.g as Float) / 255.0, (self.b as Float) / 255.0); + } + + // Create a color from hue, saturation, and value. + def from_hsv(mut h: Float, s: Float, v: Float): Color { + if s > 0.0 { + if h > 0.99999 { + h = 0.0; + } + let i = (h * 6.0) as Int; + let f = (h * 6.0) - i; + let w = (255 * v * (1.0 - s)) as Int; + let q = (255 * v * (1.0 - s * f)) as Int; + let t = (255 * v * (1.0 - s * (1.0 - f))) as Int; + let v = (255 * v) as Int; + + if i == 0 { + return { r = v, g = t, b = w, a = 255 }; + } elif i == 1 { + return { r = q, g = v, b = w, a = 255 }; + } elif i == 2 { + return { r = w, g = v, b = t, a = 255 }; + } elif i == 3 { + return { r = w, g = q, b = v, a = 255 }; + } elif i == 4 { + return { r = t, g = w, b = v, a = 255 }; + } else { + return { r = v, g = w, b = q, a = 255 }; + } + } else { + Color.from_rgb_f(v, v, v); + } + } +} + + +let c = Color.from_hsv(359/360.0, 1.0, 1.0); +// println(c.to_float()); + + + + + + + + + + + +// A rectangle has an `x` and `y` position, a `width`, and a `height`. +struct Rectangle { + x: Int, + y: Int, + width: Int, + height: Int +} + +impl Rectangle { + def make(x: Int, y: Int, width: Int, height: Int): Rectangle { + return { x = x, y = y, width = width, height = height }; + } + + // Calculate the area of a rectangle. + def area(self: &Rectangle): Int { + return self.width * self.height; + } + + // Calculate the perimeter of a rectangle. + def perimeter(self: &Rectangle): Int { + return 2 * (self.width + self.height); + } +} + +// A type for representing the dimensions of a 2D shape. +struct Size { + width: Int, + height: Int +} + +impl Size { + def make(width: Int, height: Int): Size { + return { width = width, height = height }; + } +} + +// A type for representing the position of a 2D shape. +struct Position { + x: Int, + y: Int +} + +impl Position { + def make(x: Int, y: Int): Position { + return { x = x, y = y }; + } +} + + + +struct Mouse { + x: Int, + y: Int, + left: Bool, + right: Bool +} + +impl Mouse { + def make(x: Int, y: Int, left: Bool, right: Bool): Mouse { + return { x = x, y = y, left = left, right = right }; + } + + def get_x(self: &Mouse): Int { + return self.x; + } + + def get_y(self: &Mouse): Int { + return self.y; + } + + def get_left(self: &Mouse): Bool { + return self.left; + } + + def get_right(self: &Mouse): Bool { + return self.right; + } + + def read(self: &mut Mouse, screen: &Screen) { + when IS_RISCV { + let (screen_width, screen_height) = (screen.width(), screen.height()); + match Event.read_tablet() { + of Some(event) => { + if (event.get_type() == 1) { + self.left = event.get_value() == 272; + self.right = event.get_value() == 273; + } else { + let code = event.get_code(); + let value = event.get_value(); + if code == 0 { + self.x = value * screen_width / 0x7FFF; + } elif code == 1 { + self.y = value * screen_height / 0x7FFF; + } elif code == 2 { + self.left = value == 1; + } elif code == 3 { + self.right = value == 1; + } + } + }, + _ => { + // println("Error: read() called but no mouse event was available."); + } + } + } else { + println("[Warning] Using Mouse.read on a non-RISC-V platform."); + return (); + } + } +} + + +def min(x: Int, y: Int): Int { + if x < y { + return x; + } else { + return y; + } +} + +def max(x: Int, y: Int): Int { + if x > y { + return x; + } else { + return y; + } +} + +struct Keyboard { + buf: &mut Char, + cursor: Int, + len: Int, + capacity: Int, + changed_since_last_read: Bool +} + +impl Keyboard { + def make(): Keyboard { + return { buf = calloc(1024), cursor = 0, len = 0, capacity = 1024, changed_since_last_read = False }; + } + + def has_changed(self: &mut Keyboard): Bool { + let result = self.changed_since_last_read; + self.changed_since_last_read = False; + return result; + } + + def backspace(self: &mut Keyboard) { + // Delete the character before the cursor. + if self.cursor > 0 { + self.changed_since_last_read = True; + self.cursor -= 1; + self.len -= 1; + for let mut i = self.cursor; i < self.len; i += 1 { + self.buf[i] = self.buf[i + 1]; + } + self.buf[self.len] = '\0'; + } + } + + def push(self: &mut Keyboard, c: Char) { + // Push a character onto the end of the buffer. + if self.len < self.capacity { + self.changed_since_last_read = True; + self.buf[self.len] = c; + self.len += 1; + self.cursor += 1; + } + } + + def read(self: &mut Keyboard) { + when IS_RISCV { + match Event.read_keyboard() { + of Some(event) => { + println("Keyboard event: ", event); + if event.get_value() == 0 { + // Ignore key releases. + return (); + } + let key = event.get_key(); + + if key == '\b' { + // println("Backspace"); + self.backspace(); + } elif key == '\0' { + // Try to get the arrow keys. + let code = event.get_code(); + if code == 106 { + // println("Right arrow"); + // Right arrow. + self.cursor += 1; + } elif code == 105 { + // println("Left arrow"); + // Left arrow. + self.cursor -= 1; + } else { + // println("Unknown key code: ", code); + } + } else { + // println("Key: ", key); + self.push(key); + } + }, + _ => { + // println("Error: read() called but no keyboard event was available."); + } + } + } else { + // println("[Warning] Using Keyboard.read on a non-RISC-V platform."); + let mut ch = '\0'; + input(&mut ch); + if ch != '\0' { + self.push(ch); + } + } + + self.len = min(self.len, self.capacity); + self.len = max(self.len, 0); + self.cursor = min(self.cursor, self.len); + self.cursor = max(self.cursor, 0); + } + + def clear(self: &mut Keyboard) { + self.changed_since_last_read = True; + for let mut i=0; i { + self.read(); + if self.len <= 0 { + // println("Buf: ", self.buf); + // println("No line to read (len <= 0). (self=", *self, ")"); + return Option<&Char> of Nothing; + } + + if self.buf[self.len - 1] == '\n' { + // println("Read line: ", self.buf); + return Option<&Char> of Some(self.buf); + } else { + // println("Buf: ", self.buf); + // println("No line to read. (self=", *self, ")"); + return Option<&Char> of Nothing; + } + } + + def drop(self: &mut Keyboard) { + free(self.buf); + } +} + + +def memcopy(dst: &mut T, src: &T, elems: Int) { + let size = elems * sizeof(); + let dst_ptr = dst as &mut Cell; + let src_ptr = src as &Cell; + when IS_RISCV { + // Do a memcopy using the RISC-V assembly instruction. + extern def memcpy(dst: &mut Cell, src: &Cell, size: Int); + memcpy(dst_ptr, src_ptr, size); + } else { + for let mut i=0; i(elems: Int): &mut T { + println("Allocating ", elems, " elements of size ", sizeof(), " cells."); + extern def used_memory(): Int; + extern def remaining_memory(): Int; + // println("Used memory: ", used_memory()); + // println("Remaining memory: ", remaining_memory()); + + let size = elems * sizeof(); + let result = alloc(size) as &mut T; + let cell_ptr = result as &mut Cell; + for let mut i=0; i(ptr: &mut T, elems: Int): &mut T { + // Reallocate the given pointer to the given number of elements. + println("Reallocating ", elems, " elements of size ", sizeof(), " cells."); + extern def used_memory(): Int; + extern def remaining_memory(): Int; + + let result = calloc(elems); + memcopy(result, ptr, elems); + free(ptr); + return result; +} + +struct Screen { + x_scale: Int, + y_scale: Int, + rectangle: Rectangle, + pixels: &mut Pixel, + mouse: Mouse, + keyboard: Keyboard, + has_changed: Bool, + has_flushed: Bool +} + +impl Screen { + def make(mut rectangle: Rectangle, x_scale: Int, y_scale: Int): Screen { + rectangle.width /= x_scale; + rectangle.height /= y_scale; + let pixels = calloc(rectangle.area()); + return { rectangle = rectangle, pixels = pixels, x_scale = x_scale, y_scale = y_scale, mouse = Mouse.make(0, 0, False, False), keyboard = Keyboard.make(), has_changed = True, has_flushed = False }; + } + + def make_fullscreen(x_scale: Int, y_scale: Int): Screen { + extern def screen_get_dims(): (Int, Int); + let (width, height) = screen_get_dims(); + let rectangle = Rectangle.make(0, 0, width, height); + return Screen.make(rectangle, x_scale, y_scale); + } + + def get_mouse(self: &Screen): Mouse { + return self.mouse; + } + + def read_inputs(self: &mut Screen) { + self.mouse.read(self); + self.keyboard.read(); + } + + def get_mouse_pos(self: &Screen): (Int, Int) { + return (min(max(self.mouse.x / self.x_scale, 0), self.width()), + min(max(self.mouse.y / self.y_scale, 0), self.height())); + } + + def read_line(self: &mut Screen, dst: &mut Char): Bool { + match self.keyboard.read_line() { + of Some(line) => { + for let mut i=0; line[i] != '\0' && i < self.keyboard.len; i+=1 { + dst[i] = line[i]; + } + dst[self.keyboard.len] = '\0'; + self.keyboard.clear(); + return True; + }, + _ => { + return False; + } + } + } + + def write_str(self: &mut Screen, text: &Char, color: Color, bg: Color, base_x: Int, base_y: Int): (Int, Int) { + let mut x = base_x; + let mut y = base_y; + let mut c = '\0'; + for let mut i=0; text[i] != '\0' && y <= self.height(); i+=1 { + c = text[i]; + + if c == '\n' { + y += Bitmap.HEIGHT; + x = base_x; + } elif c == '\r' { + x = base_x; + } else { + let bitmap = Bitmap.from_char(c); + self.set_bitmap(&bitmap, x, y, color, bg); + x += bitmap.width(); + } + + if (x >= self.width()) { + x = base_x; + y += Bitmap.HEIGHT; + } + } + return (x, y); + } + + def width(self: &Screen): Int { + return self.rectangle.width; + } + + def height(self: &Screen): Int { + return self.rectangle.height; + } + + def area(self: &Screen): Int { + return self.rectangle.area(); + } + + def set(self: &mut Screen, x: Int, y: Int, color: Color) { + if x * y > self.area() { + println("Error: set() called with out of bounds coordinates."); + return (); + } + + let i = y * self.width() + x; + let p = color.to_pixel(); + let old_p = &(self.pixels[i]); + if p.0 != old_p.0 || p.1 != old_p.1 || p.2 != old_p.2 || p.3 != old_p.3 { + self.has_changed = True; + self.pixels[i] = p; + } + } + + def get(self: &Screen, x: Int, y: Int): Pixel { + if x * y > self.area() { + println("Error: get() called with out of bounds coordinates."); + return Color.from_rgb(0, 0, 0).to_pixel(); + } + let i = y * self.width() + x; + return self.pixels[i]; + } + + def draw(self: &mut Screen) { + // println("Drawing..."); + self.draw_some(self.rectangle); + } + + def draw_some(self: &mut Screen, rect: Rectangle) { + // println("Drawing..."); + when IS_RISCV { + if self.has_changed { + extern def screen_draw_rect(pixels: &mut Pixel, rect: &(Int, Int, Int, Int), x_scale: Int, y_scale: Int): Int; + let tup = (rect.x * self.x_scale, rect.y * self.y_scale, rect.width, rect.height); + println("Drawing rect: ", tup); + let result = screen_draw_rect(self.pixels, &tup, self.x_scale, self.y_scale); + if result != 0 { + println("Error: screen_draw_rect failed with code ", result); + } + self.has_flushed = False; + } else { + println("No changes to draw."); + } + } + } + + def flush(self: &mut Screen) { + self.flush_some(self.rectangle); + } + + def flush_some(self: &mut Screen, rect: Rectangle) { + // println("Flushing..."); + when IS_RISCV { + if !(self.has_flushed) || self.has_changed { + extern def screen_flush(rect: &(Int, Int, Int, Int)); + let tup = (rect.x * self.x_scale, rect.y * self.y_scale, rect.width * self.x_scale, rect.height * self.y_scale); + println("Flushing rect: ", tup); + screen_flush(&tup); + self.has_flushed = True; + self.has_changed = False; + } + } else { + self.print(); + } + } + + def set_bitmap(self: &mut Screen, bitmap: &Bitmap, x: Int, y: Int, color: Color, background: Color) { + for let mut row = 0; row < bitmap.height(); row += 1 { + for let mut col = 0; col < bitmap.width(); col += 1 { + if bitmap.pixels[row][col] { + self.set(x + col, y + row, color); + } else { + self.set(x + col, y + row, background); + } + } + } + } + + def print(self: &Screen) { + if self.has_changed { + let ESC = 0x1b as Char; + + for let mut row = 0; row < self.height(); row += 1 { + for let mut col = 0; col < self.width(); col += 1 { + + // Move the cursor to the correct position. + print(ESC, "[", row, ";", col, "H"); + + // Print the pixel. + let i = row * self.width() + col; + let (r, g, b, a) = self.pixels[i]; + // println(pixel); + // let = self.pixels[i]; + print(ESC, "[48;2;", r, ";", g, ";", b, "m "); + // print(ESC, "[48;2;", self.pixels[i].r, ";", self.pixels[i].g, ";", self.pixels[i].b, "m "); + } + } + + // Move cursor to bottom left + print(ESC, "[", self.height(), ";0H"); + } else { + println("No changes to print."); + } + } + + def drop(self: &mut Screen) { + self.keyboard.drop(); + free(self.pixels); + } + + def clear(self: &mut Screen, color: Color) { + for let mut row = 0; row < self.height(); row += 1 { + for let mut col = 0; col < self.width(); col += 1 { + self.set(col, row, color); + } + } + } + + def clear_some(self: &mut Screen, rect: Rectangle, color: Color) { + for let mut row = rect.y; row < rect.y + rect.height; row += 1 { + for let mut col = rect.x; col < rect.x + rect.width; col += 1 { + self.set(col, row, color); + } + } + } +} + +type Event = (Int, Int, Int); +let static mut KEYBOARD_SHIFT: Bool = False; + +impl Event { + def read_keyboard(): Option { + extern def get_keyboard_event(): Event; + let event = get_keyboard_event(); + + if event.get_type() == 1 { + return Option of Some(event); + } else { + // println("Error: read_keyboard() called but no keyboard event was available (event=", event, ")."); + return Option of Nothing; + } + } + + def read_tablet(): Option { + extern def get_table_event(): Event; + let event = get_table_event(); + if event.get_type() == 1 && (event.get_code() == 272 || event.get_code() == 273) { + return Option of Some(event); + } elif event.get_type() == 3 { + return Option of Some(event); + } else { + // println("Error: read_tablet() called but no tablet event was available (event=", event, ")."); + return Option of Nothing; + } + } + + def get_type(self: &Event): Int { + return self.0; + } + + def get_code(self: &Event): Int { + return self.1; + } + + def get_value(self: &Event): Int { + return self.2; + } + + const KEYS = { + A=30, + B=48, + C=46, + D=32, + E=18, + F=33, + G=34, + H=35, + I=23, + J=36, + K=37, + L=38, + M=50, + N=49, + O=24, + P=25, + Q=16, + R=19, + S=31, + T=20, + U=22, + V=47, + W=17, + X=45, + Y=21, + Z=44, + ESC=1, + BACKSPACE=14, + ENTER=28, + NUM_0=11, + NUM_1=2, + NUM_2=3, + NUM_3=4, + NUM_4=5, + NUM_5=6, + NUM_6=7, + NUM_7=8, + NUM_8=9, + NUM_9=10, + SPACE=57, + SLASH=53, + PERIOD=52 + }; + + const NUM_SHIFT_KEYS = [ + ')', + '!', + '@', + '#', + '$', + '%', + '^', + '&', + '*', + '(' + ]; + + def num_keys(): Int { + return sizeof(Event.KEYS) / sizeof(Event.KEYS.A); + } + + def get_key(self: &Event): Char { + def code_to_key(code: Int): Char { + let mut ret = '\0'; + + ret = match code { + (Event.KEYS.A) => 'a', + (Event.KEYS.B) => 'b', + (Event.KEYS.C) => 'c', + (Event.KEYS.D) => 'd', + (Event.KEYS.E) => 'e', + (Event.KEYS.F) => 'f', + (Event.KEYS.G) => 'g', + (Event.KEYS.H) => 'h', + (Event.KEYS.I) => 'i', + (Event.KEYS.J) => 'j', + (Event.KEYS.K) => 'k', + (Event.KEYS.L) => 'l', + (Event.KEYS.M) => 'm', + (Event.KEYS.N) => 'n', + (Event.KEYS.O) => 'o', + (Event.KEYS.P) => 'p', + (Event.KEYS.Q) => 'q', + (Event.KEYS.R) => 'r', + (Event.KEYS.S) => 's', + (Event.KEYS.T) => 't', + (Event.KEYS.U) => 'u', + (Event.KEYS.V) => 'v', + (Event.KEYS.W) => 'w', + (Event.KEYS.X) => 'x', + (Event.KEYS.Y) => 'y', + (Event.KEYS.Z) => 'z', + (Event.KEYS.NUM_0) => '0', + (Event.KEYS.NUM_1) => '1', + (Event.KEYS.NUM_2) => '2', + (Event.KEYS.NUM_3) => '3', + (Event.KEYS.NUM_4) => '4', + (Event.KEYS.NUM_5) => '5', + (Event.KEYS.NUM_6) => '6', + (Event.KEYS.NUM_7) => '7', + (Event.KEYS.NUM_8) => '8', + (Event.KEYS.NUM_9) => '9', + (Event.KEYS.BACKSPACE) => '\b', + (Event.KEYS.ENTER) => '\n', + (Event.KEYS.ESC) => '~', + (Event.KEYS.SPACE) => ' ', + (Event.KEYS.SLASH) => '/', + (Event.KEYS.PERIOD) => '.', + + _ => { + println("Error: code_to_key() called with invalid code ", code); + return '\0'; + } + }; + + println("ret = ", ret); + + if KEYBOARD_SHIFT { + println("Shift is down."); + if ret as Int >= 'a' as Int && ret as Int <= 'z' as Int { + println("Converting to uppercase."); + ret = (ret as Int - 32) as Char; + println("ret = ", ret); + } elif ret as Int >= '0' as Int && ret as Int <= '9' as Int { + let num_shift_keys = Event.NUM_SHIFT_KEYS; + println("Converting to shifted number."); + ret = num_shift_keys[ret as Int - '0' as Int]; + println("ret = ", ret); + } + } + return ret; + } + + return code_to_key(self.get_code()); + } + + def print(self: &Event) { + let ty = self.get_type(); + let code = self.get_code(); + let value = self.get_value(); + println("Event: type=", ty, ", code=", code, ", value=", value); + } +} + +def count_lines(s: &Char): Int { + let mut count = 0; + for let mut i=0; s[i] != '\0'; i+=1 { + if s[i] == '\n' { + count += 1; + } + } + return count; +} + +def strlen(s: &Char): Int { + when IS_RISCV { + extern def strlen(s: &Char): Int; + return strlen(s); + } else { + let mut i = 0; + for (); s[i] != '\0'; i += 1 {} + return i; + } +} + +def strcomp(s1: &Char, s2: &Char): Int { + when IS_RISCV { + extern def strcmp(s1: &Char, s2: &Char, len: Int): Int; + let len = max(strlen(s1), strlen(s2)); + return strcmp(s1, s2, len); + } else { + let mut i = 0; + for (); s1[i] != '\0' && s2[i] != '\0' && s1[i] == s2[i]; i += 1 {} + return s1[i] as Int - s2[i] as Int; + } +} + +type Symbol = [Char * 64]; + +impl Symbol { + def make(): Symbol { + return ['\0'] * sizeof(); + } + + def is_empty(self: &Symbol): Bool { + return self.len() == 0; + } + + def eq(self: &Symbol, other: &Symbol): Bool { + return strcomp(self.str(), other.str()) == 0; + } + + def from_str(s: &Char): Symbol { + let mut result = Symbol.make(); + let (mut i, mut j) = (0, 0); + let mut last_was_slash = False; + for (); i < sizeof() - 1 && s[i] != '\0'; i += 1 { + if s[i] == ' ' || s[i] == '\n' || s[i] == '\r' || s[i] == '\t' { + // Skip whitespace. + } else { + if last_was_slash && s[i] == '/' { + // Skip duplicate slashes. + } else { + last_was_slash = s[i] == '/'; + result[j] = s[i]; + j += 1; + } + } + } + + return result; + } + + def begins_with(self: &Symbol, other: &Char): Bool { + let str = self.str(); + for let mut i = 0; str[i] != '\0' && other[i] != '\0'; i += 1 { + if str[i] != other[i] { + return False; + } + } + return True; + } + + def remove_front(self: &mut Symbol, n: Int) { + let mut i = 0; + let str = self.str_mut(); + for (); i < sizeof() - 1 && str[i] != '\0'; i += 1 { + str[i] = str[i + n]; + } + str[i] = '\0'; + } + + def str(self: &Symbol): &Char { + return self as &Char; + } + + def str_mut(self: &mut Symbol): &mut Char { + return self as &mut Char; + } + + def len(self: &Symbol): Int { + return strlen(self.str()); + } + + def print(self: &Symbol) { + print(self.str()); + } + + def println(self: &Symbol) { + println(self.str()); + } +} + +type Path = [Char * 128]; + +let mut root = ['\0'] * sizeof(); +root[0] = '/'; +let static ROOT: Path = root; + +let mut home = ['\0'] * sizeof(); +home[0] = '/'; +home[1] = 'h'; +home[2] = 'o'; +home[3] = 'm'; +home[4] = 'e'; +home[5] = '/'; +home[6] = 'c'; +home[7] = 'o'; +home[8] = 's'; +home[9] = 'c'; +home[10] = '5'; +home[11] = '6'; +home[12] = '2'; +home[13] = '\0'; +let static HOME: Path = home; + + + +impl Path { + def make(): Path { + return ['\0'] * sizeof(); + } + + def root(): &Path { + return &ROOT; + } + + def home(): &Path { + return &HOME; + } + + def str(self: &Path): &Char { + return self as &Char; + } + + def str_mut(self: &mut Path): &mut Char { + return self as &mut Char; + } + + def is_root(self: &Path): Bool { + return self.str()[0] == '/' && self.str()[1] == '\0'; + } + + def is_home(self: &Path): Bool { + return strcomp(self.str(), &"/home/cosc562" as &Char) == 0; + } + + def is_empty(self: &Path): Bool { + return self.str()[0] == '\0'; + } + + def copy_from(self: &mut Path, other: &Path) { + let str = self.str_mut(); + let mut i = 0; + for (); i < sizeof() - 1 && other.str()[i] != '\0'; i += 1 { + str[i] = other.str()[i]; + } + str[i] = '\0'; + } + + def from_str(s: &Char): Path { + let mut path = Path.make(); + path[0] = '/'; + let (mut i, mut j) = (1, 1); + for (); i < sizeof() - 1 && s[i] != '\0'; i += 1 { + // Skip duplicate slashes, whitespace, and trailing slashes. + match s[i] { + '/' => { + if j > 0 && path[j - 1] != '/' { + path[j] = s[i]; + j += 1; + } + }, + '\n' | '\r' | '\t'=> { + // Skip whitespace. + }, + ' ' => { + if j > 0 && path[j - 1] != '/' { + path[j] = s[i]; + j += 1; + } + }, + _ => { + path[j] = s[i]; + j += 1; + } + } + } + return path; + } + + def get_name(self: &Path): &Char { + if self.is_root() { + return &"/"; + } + + let str = self.str(); + let mut i = 0; + for let mut j = 0; str[j] != '\0'; j += 1 { + if str[j] == '/' { + i = j + 1; + } + } + return &(str[i]); + } + + def depth(self: &Path): Int { + let mut depth = 0; + let str = self.str(); + for let mut i = 0; str[i] != '\0'; i += 1 { + if str[i] == '/' { + depth += 1; + } + } + return depth; + } + + def len(self: &Path): Int { + return strlen(self.str()); + } + + def push(self: &mut Path, s: &mut Symbol) { + println("Pushing ", s.str(), " onto ", self.str()); + if s.is_empty() { + return (); + } + + if strcomp(s.str(), &"." as &Char) == 0 { + return (); + } elif s.begins_with(&"./" as &Char) { + s.remove_front(2); + self.push(s); + // self.push(Symbol.from_str(&(s.str()[2]))); + return (); + } elif strcomp(s.str(), &".." as &Char) == 0 { + // *self = self.get_parent(); + let _ = self.pop(); + return (); + } elif s.begins_with(&"../" as &Char) { + // *self = self.get_parent(); + let _ = self.pop(); + s.remove_front(3); + self.push(s); + // self.push(Symbol.from_str(&(s.str()[3]))); + return (); + } elif strcomp(s.str(), &"/" as &Char) == 0 { + // *self = Path.root(); + let str = self.str_mut(); + str[0] = '/'; + str[1] = '\0'; + return (); + } elif s.begins_with(&"/" as &Char) { + // *self = self.get_parent(); + // *self = Path.root(); + let str = self.str_mut(); + str[0] = '/'; + str[1] = '\0'; + s.remove_front(1); + self.push(s); + // self.push(Symbol.from_str(&(s.str()[3]))); + return (); + } elif strcomp(s.str(), &"~" as &Char) == 0 { + let str = self.str_mut(); + str[0] = '/'; + str[1] = 'h'; + str[2] = 'o'; + str[3] = 'm'; + str[4] = 'e'; + str[5] = '/'; + str[6] = 'c'; + str[7] = 'o'; + str[8] = 's'; + str[9] = 'c'; + str[10] = '5'; + str[11] = '6'; + str[12] = '2'; + str[13] = '\0'; + return (); + } elif s.begins_with(&"~/" as &Char) { + let str = self.str_mut(); + str[0] = '/'; + str[1] = 'h'; + str[2] = 'o'; + str[3] = 'm'; + str[4] = 'e'; + str[5] = '/'; + str[6] = 'c'; + str[7] = 'o'; + str[8] = 's'; + str[9] = 'c'; + str[10] = '5'; + str[11] = '6'; + str[12] = '2'; + str[13] = '\0'; + + s.remove_front(2); + self.push(s); + // self.push(Symbol.from_str(&(s.str()[2]))); + return (); + } + + let mut i = 0; + let str = self.str_mut(); + // Add a slash if necessary. + for i=0; str[i] != '\0'; i += 1 {} + if i > 0 && str[i - 1] != '/' { + str[i] = '/'; + i += 1; + } + println("i=", i); + let src_str = s.str(); + let mut is_done = False; + for let mut j = 0; j < sizeof() - 1 && src_str[j] != '\0' && !is_done; j += 1 { + println("j=", j, ", s[j]=", src_str[j]); + if src_str[j] == '/' { + // Recursively push the rest of the path. + s.remove_front(j + 1); + str[i] = '\0'; + self.push(s); + is_done = True; + } else { + str[i] = src_str[j]; + i += 1; + } + } + if !is_done { + str[i] = '\0'; + } + // str[i + sizeof() - 1] = '\0'; + } + + def pop(self: &mut Path): Symbol { + if self.is_root() || self.is_empty() { + return Symbol.make(); + } + + let mut i = 0; + let str = self.str_mut(); + for let mut j = 0; str[j] != '\0'; j += 1 { + if str[j] == '/' { + i = j + 1; + } + } + let mut result = Symbol.make(); + for let mut j = 0; j < sizeof() - 1; j += 1 { + result[j] = str[i + j]; + } + result[sizeof() - 1] = '\0'; + for let mut j = i; j < sizeof() - 1; j += 1 { + str[j] = '\0'; + } + + return result; + } + + def print(self: &Path) { + print(self.str()); + } + + def println(self: &Path) { + println(self.str()); + } +} + +type SmolString = [Char * 256]; + +impl SmolString { + def make(): SmolString { + return ['\0'] * sizeof(); + } + + def from_int(n: Int): SmolString { + let mut result = SmolString.make(); + let mut i = 0; + let mut j = 0; + let mut digits = [0] * 64; + if n < 0 { + result[j] = '-'; + j += 1; + i += 1; + } + let mut n = n; + while n > 0 { + digits[i] = n % 10; + n /= 10; + i += 1; + } + if i == 0 { + digits[i] = 0; + i += 1; + } + for (); i > 0; i -= 1 { + result[j] = (digits[i - 1] as Int + '0' as Int) as Char; + j += 1; + } + result[j] = '\0'; + return result; + } + + def count_lines(self: &SmolString): Int { + return count_lines(self.str()); + } + + def append(self: &mut SmolString, other: &SmolString) { + self.push_str(other.str()); + } + + def push_str(self: &mut SmolString, s: &Char) { + let len = self.len(); + let str = self.str_mut(); + let mut i = 0; + for (); i + len < sizeof() - 1 && s[i] != '\0'; i += 1 { + str[len + i] = s[i]; + } + // Add a null terminator. + str[len + i] = '\0'; + } + + def push_int(self: &mut SmolString, n: Int) { + let s = SmolString.from_int(n); + self.push_str(s.str()); + } + + def from_str(s: &Char): SmolString { + let mut result = SmolString.make(); + for let mut i = 0; i < sizeof() - 1 && s[i] != '\0'; i += 1 { + result[i] = s[i]; + } + return result; + } + + def nth_symbol(self: &SmolString, mut n: Int): Option { + let mut i = 0; + let mut j = 0; + let mut result = Symbol.make(); + let str = self.str(); + for (); str[i] != '\0'; i += 1 { + if str[i] == ' ' || str[i] == '\n' || str[i] == '\r' || str[i] == '\t' { + // Skip whitespace. + if j > 0 { + result[j] = '\0'; + if n == 0 { + return Option of Some(result); + } + n -= 1; + j = 0; + } + } else { + result[j] = str[i]; + j += 1; + } + } + if j > 0 { + result[j] = '\0'; + if n == 0 { + return Option of Some(result); + } + n -= 1; + j = 0; + } + return Option of Nothing; + } + + def trim_start(self: &mut SmolString, pattern: &Char) { + let mut i = 0; + let mut j = 0; + let mut result = SmolString.make(); + let str = self.str(); + for (); str[i] != '\0' && str[i] == pattern[i]; i += 1 {} + for (); str[i] != '\0'; i += 1 { + result[j] = str[i]; + j += 1; + } + + result[j] = '\0'; + memcopy(self, &result, sizeof()); + } + + def trim_whitespace(self: &mut SmolString) { + let mut i = 0; + let str = self.str(); + for (); str[i] != '\0' && (str[i] == ' ' || str[i] == '\n' || str[i] == '\r' || str[i] == '\t'); i += 1 {} + let mut j = 0; + let mut result = SmolString.make(); + for (); str[i] != '\0'; i += 1 { + result[j] = str[i]; + j += 1; + } + result[j] = '\0'; + memcopy(self, &result, sizeof()); + } + + def str(self: &SmolString): &Char { + return self as &Char; + } + + def str_mut(self: &mut SmolString): &mut Char { + return self as &mut Char; + } + + def len(self: &SmolString): Int { + return strlen(self.str()); + } + + def print(self: &SmolString) { + print(self.str()); + } + + def println(self: &SmolString) { + println(self.str()); + } +} + +enum FileMode { + Read, + Write, + Append +} + +struct OS { + list_dir: (&mut Env, &Path) -> Result<(), Error>, + spawn: (&mut Env, &Path) -> Result, + open: (&mut Env, &Path, FileMode) -> Result<&mut File, Error>, + create_dir: (&mut Env, &Path) -> Result<(), Error>, + is_dir: (&mut Env, &Path) -> Result, + is_file: (&mut Env, &Path) -> Result, + list_pid: (&mut Env) -> Result<(), Error>, + list_mem: (&mut Env) -> Result<(), Error>, + print_env: (&mut Env) -> Result<(), Error>, + print_dir: (&mut Env) -> Result<(), Error>, + change_dir: (&mut Env, &Path) -> Result<(), Error>, + read: (&mut Env, &Path) -> Result, + write: (&mut Env, &Path) -> Result<(), Error>, + append: (&mut Env, &Path) -> Result<(), Error>, + close: (&mut Env, &mut File) -> Result<(), Error>, + copy: (&mut Env, &Path, &Path) -> Result<(), Error>, + remove: (&mut Env, &Path) -> Result<(), Error>, + make_dir: (&mut Env, &Path) -> Result<(), Error>, + help: (&mut Env, &Symbol) -> Result<(), Error>, + exit: (&mut Env) -> Result<(), Error> +} + +impl OS { + def make(): OS { + when IS_RISCV { + def open(env: &mut Env, path: &Path, mode: FileMode): Result<&mut File, Error> { + // println("Opening file ", path, "..."); + env.echo_colored(&"Opening ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<&mut File, Error> of Ok(new File.make(*path, FileMode of Read)); + } + + def spawn(env: &mut Env, path: &Path): Result { + // println("Changing directory to ", path, "..."); + env.echo_colored(&"Spawning ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + extern def path_exists(path: &Char): Bool; + if !(path_exists(path.str())) { + env.echo_coloredln(&"Path does not exist!", Color.RED); + return Result of Err(Error of PathNotFound path); + } + + extern def spawn_process(path: &Char): Int; + let pid = spawn_process(path.str()); + if pid < 0 { + env.echo_coloredln(&"Failed to spawn process!", Color.RED); + return Result of Err(Error of ProcessSpawnFailed path); + } + + return Result of Ok(pid); + } + + def create_dir(env: &mut Env, path: &Path): Result<(), Error> { + // println("Creating directory ", path, "..."); + env.echo_colored(&"Creating ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def is_dir(env: &mut Env, path: &Path): Result { + // println("Checking if ", path, " is a directory..."); + env.echo_colored(&"Checking if", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&" is dir...", Color.GREEN); + + extern def path_is_dir(path: &Char): Bool; + return Result of Ok(path_is_dir(path.str())); + } + + def is_file(env: &mut Env, path: &Path): Result { + // println("Checking if ", path, " is a file..."); + env.echo_colored(&"Checking if ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&" is file...", Color.GREEN); + + extern def path_is_file(path: &Char): Bool; + return Result of Ok(path_is_file(path.str())); + } + + def list_dir(env: &mut Env, path: &Path): Result<(), Error> { + env.disable_flush(); + env.echo_colored(&"Listing ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + extern def path_list_dir(path: &Char, buf: &mut Char, buf_len: Int, use_full_path: Bool): Int; + let mut buf = ['\0'] * 1024; + + let use_full_path = False; + let ret = path_list_dir(path.str(), &mut buf as &mut Char, sizeof(buf), use_full_path); + if (ret < 0) { + return Result<(), Error> of Err(Error of PathNotFound path); + } + + env.echo_coloredln(&buf, Color.BLUE); + + return Result<(), Error> of Ok(()); + } + + + def list_pid(env: &mut Env): Result<(), Error> { + // println("Listing PID..."); + env.echo_coloredln(&"Listing PID...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def list_mem(env: &mut Env): Result<(), Error> { + // println("Listing memory..."); + env.echo_coloredln(&"Listing memory...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def print_env(env: &mut Env): Result<(), Error> { + println("Printing environment..."); + env.echo_coloredln(&"Printing environment...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def print_dir(env: &mut Env): Result<(), Error> { + println("Printing directory..."); + env.echo_coloredln(&"Printing directory...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def change_dir(env: &mut Env, path: &Path): Result<(), Error> { + // println("Changing directory to ", path, "..."); + env.echo_colored(&"Changing directory to ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + extern def path_exists(path: &Char): Bool; + if !(path_exists(path.str())) { + env.echo_coloredln(&"Path does not exist!", Color.RED); + return Result<(), Error> of Err(Error of PathNotFound path); + } + + return Result<(), Error> of Ok(()); + } + + def read(env: &mut Env, path: &Path): Result { + // println("Reading file ", path, "..."); + env.echo_colored(&"Reading file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result of Ok(SmolString.make()); + } + + def write(env: &mut Env, path: &Path): Result<(), Error> { + // println("Writing to file ", path, "..."); + env.echo_colored(&"Writing to file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def append(env: &mut Env, path: &Path): Result<(), Error> { + // println("Appending to file ", path, "..."); + env.echo_colored(&"Appending to file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def close(env: &mut Env, file: &mut File): Result<(), Error> { + // println("Closing file ", path, "..."); + env.echo_colored(&"Closing file ", Color.GREEN); + env.echo_colored(file.get_path().str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def copy(env: &mut Env, src: &Path, dst: &Path): Result<(), Error> { + // println("Copying file ", src, " to ", dst, "..."); + env.echo_colored(&"Copying file ", Color.GREEN); + env.echo_colored(src.str(), Color.BLUE); + env.echo_colored(&" to ", Color.GREEN); + env.echo_colored(dst.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def remove(env: &mut Env, path: &Path): Result<(), Error> { + // println("Removing file ", path, "..."); + env.echo_colored(&"Removing file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def make_dir(env: &mut Env, path: &Path): Result<(), Error> { + // println("Making directory ", path, "..."); + env.echo_colored(&"Making directory ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def help(env: &mut Env, path: &Symbol): Result<(), Error> { + // println("Helping..."); + env.echo_coloredln(&"Helping...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def exit(env: &mut Env): Result<(), Error> { + // println("Exiting..."); + env.echo_coloredln(&"Exiting...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + return { + list_dir = list_dir, + open = open, + spawn = spawn, + create_dir = create_dir, + is_dir = is_dir, + is_file = is_file, + list_pid = list_pid, + list_mem = list_mem, + print_env = print_env, + print_dir = print_dir, + change_dir = change_dir, + read = read, + write = write, + append = append, + close = close, + copy = copy, + remove = remove, + make_dir = make_dir, + help = help, + exit = exit + }; + } else { + def list_dir(env: &mut Env, path: &Path): Result<(), Error> { + // println("Listing directory ", path, "..."); + env.echo_colored(&"Listing ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def spawn(env: &mut Env, path: &Path): Result { + env.echo_colored(&"Spawning ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result of Ok(0); + } + + def open(env: &mut Env, path: &Path, mode: FileMode): Result<&mut File, Error> { + // println("Opening file ", path, "..."); + env.echo_colored(&"Opening ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<&mut File, Error> of Ok(new File.make(*path, FileMode of Read)); + } + + def create_dir(env: &mut Env, path: &Path): Result<(), Error> { + // println("Creating directory ", path, "..."); + env.echo_colored(&"Creating ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def is_dir(env: &mut Env, path: &Path): Result { + // println("Checking if ", path, " is a directory..."); + env.echo_colored(&"Checking if", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&" is dir...", Color.GREEN); + + return Result of Ok(False); + } + + def is_file(env: &mut Env, path: &Path): Result { + // println("Checking if ", path, " is a file..."); + env.echo_colored(&"Checking if ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&" is file...", Color.GREEN); + + return Result of Ok(True); + } + + def list_pid(env: &mut Env): Result<(), Error> { + // println("Listing PID..."); + env.echo_coloredln(&"Listing PID...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def list_mem(env: &mut Env): Result<(), Error> { + // println("Listing memory..."); + env.echo_coloredln(&"Listing memory...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def print_env(env: &mut Env): Result<(), Error> { + println("Printing environment..."); + env.echo_colored(&"Printing environment...", Color.GREEN); + env.echo_newline(); + return Result<(), Error> of Ok(()); + } + + def print_dir(env: &mut Env): Result<(), Error> { + println("Printing directory..."); + env.echo_colored(&"Printing directory...", Color.GREEN); + env.echo_newline(); + return Result<(), Error> of Ok(()); + } + + def change_dir(env: &mut Env, path: &Path): Result<(), Error> { + // println("Changing directory to ", path, "..."); + env.echo_colored(&"Changing directory to ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def read(env: &mut Env, path: &Path): Result { + // println("Reading file ", path, "..."); + env.echo_colored(&"Reading file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result of Ok(SmolString.make()); + } + + def write(env: &mut Env, path: &Path): Result<(), Error> { + // println("Writing to file ", path, "..."); + env.echo_colored(&"Writing to file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def append(env: &mut Env, path: &Path): Result<(), Error> { + // println("Appending to file ", path, "..."); + env.echo_colored(&"Appending to file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + return Result<(), Error> of Ok(()); + } + + def close(env: &mut Env, path: &mut File): Result<(), Error> { + // println("Closing file ", path, "..."); + env.echo_colored(&"Closing file ", Color.GREEN); + env.echo_colored(path.get_path().str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def copy(env: &mut Env, src: &Path, dst: &Path): Result<(), Error> { + // println("Copying file ", src, " to ", dst, "..."); + env.echo_colored(&"Copying file ", Color.GREEN); + env.echo_colored(src.str(), Color.BLUE); + env.echo_colored(&" to ", Color.GREEN); + env.echo_colored(dst.str(), Color.BLUE); + env.echo_coloredln(&"...", Color.GREEN); + + return Result<(), Error> of Ok(()); + } + + def remove(env: &mut Env, path: &Path): Result<(), Error> { + // println("Removing file ", path, "..."); + env.echo_colored(&"Removing file ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_colored(&"...", Color.GREEN); + env.echo_newline(); + + return Result<(), Error> of Ok(()); + } + + def make_dir(env: &mut Env, path: &Path): Result<(), Error> { + // println("Making directory ", path, "..."); + env.echo_colored(&"Making directory ", Color.GREEN); + env.echo_colored(path.str(), Color.BLUE); + env.echo_colored(&"...", Color.GREEN); + env.echo_newline(); + + return Result<(), Error> of Ok(()); + } + + def help(env: &mut Env, path: &Symbol): Result<(), Error> { + // println("Helping..."); + env.echo_colored(&"Helping...", Color.GREEN); + env.echo_newline(); + + return Result<(), Error> of Ok(()); + } + + def exit(env: &mut Env): Result<(), Error> { + // println("Exiting..."); + env.echo_colored(&"Exiting...", Color.GREEN); + env.echo_newline(); + + return Result<(), Error> of Ok(()); + } + + return { + list_dir = list_dir, + spawn = spawn, + open = open, + create_dir = create_dir, + is_dir = is_dir, + is_file = is_file, + list_pid = list_pid, + list_mem = list_mem, + print_env = print_env, + print_dir = print_dir, + change_dir = change_dir, + read = read, + write = write, + append = append, + close = close, + copy = copy, + remove = remove, + make_dir = make_dir, + help = help, + exit = exit + }; + } + } +} + +struct File { + path: Path, + mode: FileMode +} + + +impl File { + def make(path: Path, mode: FileMode): File { + return { path = path, mode = mode }; + } + + def open(path: &Path, mode: FileMode, env: &mut Env): Result<&mut File, Error> { + return env.get_os().open(env, path, mode); + } + + def create_dir(path: &Path, env: &mut Env): Result<(), Error> { + return env.get_os().create_dir(env, path); + } + + def list_dir(path: &Path, env: &mut Env): Result<(), Error> { + return env.get_os().list_dir(env, path); + } + + def is_dir(self: &File, env: &mut Env): Bool { + return env.get_os().is_dir(env, &(self.path)).unwrap_or(False); + } + + def is_file(self: &File, env: &mut Env): Bool { + return env.get_os().is_file(env, &(self.path)).unwrap_or(False); + } + + def get_path(self: &File): &Path { + return &(self.path); + } + + def get_name(self: &File): &Char { + return self.path.get_name(); + } + + // def get_parent(self: &File): Path { + // return self.path.get_parent(); + // } + + def write(self: &File, text: &Char, env: &mut Env): Result<(), Error> { + return env.get_os().write(env, &(self.path)); + } + + def read(self: &File, env: &mut Env): Result { + return env.get_os().read(env, &(self.path)); + } + + def close(self: &mut File, env: &mut Env): Result<(), Error> { + return env.get_os().close(env, self); + } +} + + +enum Command { + Read(Symbol), + Write(Symbol, SmolString), + Append(Symbol, SmolString), + Copy(Symbol, Symbol), + MakeDir(Symbol), + ChangeDir(Symbol), + Spawn(Symbol), + Clear, + PrintDir, + ListDir, + ListPID, + ListMem, + Help(Symbol), + PrintEnv, + Invalid(SmolString) +} + +struct History { + commands: &mut Command, + length: Int, + capacity: Int +} + +impl History { + def make(): History { + return { commands = calloc(8), length = 0, capacity = 8 }; + } + + def push(self: &mut History, command: Command) { + if self.length >= self.capacity { + // Grow the array. + self.capacity *= 2; + self.commands = realloc(self.commands, self.capacity); + } + self.commands[self.length] = command; + self.length += 1; + if self.length >= self.capacity { + // Grow the array. + self.capacity *= 2; + self.commands = realloc(self.commands, self.capacity); + } + } + + def len(self: &History): Int { + return self.length; + } + + def get(self: &History, index: Int): Option<&Command> { + if index < 0 || index >= self.length { + return Option<&Command> of Nothing; + } + return Option<&Command> of Some(&(self.commands[index])); + } + + def drop(self: &mut History) { + free(self.commands); + } + + def print(self: &History) { + for let mut i = 0; i < self.length; i += 1 { + print(i, ": "); + self.commands[i].println(); + } + } + + def echo(self: &History, env: &mut Env) { + for let mut i = 0; i < self.length; i += 1 { + let s = SmolString.from_int(i); + // print(i, ": "); + env.echo(s.str()); + env.echo(&": " as &Char); + self.commands[i].echo(env); + } + } +} + +struct Env { + os: OS, + cwd: Path, + history: History, + screen: Screen, + + prompt_row: Int, + prompt_col: Int, + + flush: Bool, + + echo_row: Int, + echo_col: Int +} + +impl Env { + def make(mut screen: Screen): Env { + screen.clear(Color.BLACK); + screen.draw(); + screen.flush(); + return { cwd = *(Path.home()), history = History.make(), os = OS.make(), screen = screen, echo_row = 0, echo_col = 0, prompt_row = 0, prompt_col = 0, flush = True }; + } + + def echo_space(self: &mut Env) { + self.echo(&" " as &Char); + } + + def echo_newline(self: &mut Env) { + self.echo_col = 0; + self.echo(&"\r\n" as &Char); + } + + def echo_tab(self: &mut Env) { + self.echo(&"\t" as &Char); + } + + def echo_solid_block(self: &mut Env, color: Color) { + // self.echo(&"█" as &Char); + let str = [1 as Char, '\0']; + // self.echo(&str as &Char); + self.echo_colored(&str as &Char, color); + } + + def echo_light_block(self: &mut Env, color: Color) { + // self.echo(&"▒" as &Char); + let str = [2 as Char, '\0']; + // self.echo(&str as &Char); + self.echo_colored(&str as &Char, color); + } + + def read_line(self: &mut Env, dst: &mut Char): Bool { + when IS_RISCV { + self.screen.keyboard.read(); + + // Draw the entered text on the screen. + if self.screen.keyboard.has_changed() { + println("Keyboard has changed!"); + let (row, col) = self.echo_colored_at(self.screen.keyboard.buf, Color.YELLOW, self.prompt_row, self.prompt_col); + // Write some spaces to clear the rest of the line. + let _ = self.echo_colored_at(&" " as &Char, Color.YELLOW, row, col); + } + + if self.screen.keyboard.len <= 0 { + // println("Buf: ", self.buf); + // println("No line to read (len <= 0). (self=", *self, ")"); + return False; + } + + // Clear the line on the screen. + // self.screen.draw_some() + + if self.screen.keyboard.buf[self.screen.keyboard.len - 1] == '\n' { + println("Read line: ", self.screen.keyboard.buf); + // Copy the line into the destination buffer. + for let mut i=0; i < self.screen.keyboard.len; i+=1 { + dst[i] = self.screen.keyboard.buf[i]; + } + dst[self.screen.keyboard.len] = '\0'; + // Clear the keyboard buffer. + self.screen.keyboard.clear(); + self.echo_newline(); + // extern def strncpy(dst: &mut Char, src: &Char, n: Int); + // strncpy(dst, self.screen.keyboard.buf,); + + // return Option<&Char> of Some(self.buf); + return True; + } else { + // println("Buf: ", self.buf); + // println("No line to read. (self=", *self, ")"); + return False; + } + } else { + self.echo_newline(); + return self.screen.read_line(dst); + } + } + + def get_cwd(self: &Env): &Path { + return &(self.cwd); + } + + def prompt(self: &mut Env) { + let mut prompt = SmolString.from_str(self.cwd.str()); + prompt.push_str(&"$ " as &Char); + // // self.screen.write_str(prompt.str(), Color.WHITE, 0, self.echo_row * Bitmap.HEIGHT); + // self.echo_col += prompt.len(); + if (self.echo_col != 0) { + self.echo_newline(); + } + self.echo(prompt.str()); + self.prompt_row = self.echo_row; + self.prompt_col = self.echo_col; + self.enable_flush(); + } + + def echo_coloredln(self: &mut Env, text: &Char, color: Color) { + self.echo_colored(text, color); + self.echo_newline(); + } + + def echo_colored_at(self: &mut Env, text: &Char, color: Color, mut row: Int, mut col: Int): (Int, Int) { + if row >= self.screen.height() / Bitmap.HEIGHT { + row = 0; + col = 0; + self.screen.clear(Color.BLACK); + } + + let (mut old_x, mut old_y) = (col * Bitmap.WIDTH, row * Bitmap.HEIGHT); + + let (new_x, new_y) = self.screen.write_str(text, color, Color.BLACK, old_x, old_y); + col = new_x / Bitmap.WIDTH; + row = new_y / Bitmap.HEIGHT; + + if self.flush { + when IS_RISCV { + self.screen.draw(); + self.screen.flush(); + } else { + // If it ends with a newline + self.screen.print(); + } + } + + return (row, col); + } + + def clear_screen(self: &mut Env) { + self.screen.clear(Color.BLACK); + self.screen.draw(); + self.screen.flush(); + self.echo_row = 0; + self.echo_col = 0; + self.prompt_row = 0; + self.prompt_col = 0; + } + + def enable_flush(self: &mut Env) { + self.flush = True; + if self.screen.has_changed { + self.screen.draw(); + self.screen.flush(); + } + } + + def disable_flush(self: &mut Env) { + self.flush = False; + } + + def echo_colored(self: &mut Env, text: &Char, color: Color) { + let (new_row, new_col) = self.echo_colored_at(text, color, self.echo_row, self.echo_col); + self.echo_row = new_row; + self.echo_col = new_col; + } + + def echo(self: &mut Env, text: &Char) { + self.echo_colored(text, Color.WHITE); + } + + def echoln(self: &mut Env, text: &Char) { + self.echo(text); + self.echo_newline(); + } + + def get_cwd_mut(self: &mut Env): &mut Path { + return &mut (self.cwd); + } + + def get_os(self: &Env): &OS { + return &(self.os); + } + + def get_history(self: &Env): &History { + return &(self.history); + } + + def get_history_mut(self: &mut Env): &mut History { + return &mut (self.history); + } + + def print(self: &mut Env) { + // println("Env: os=", self.os); + // println("Env: cwd=", self.cwd); + self.os.print_env(self).unwrap(); + self.history.echo(self); + } + + def drop(self: &mut Env) { + self.history.drop(); + } +} + +let read = Symbol.from_str(&"cat" as &Char); +let static READ_SYMBOL: Symbol = read; +let write = Symbol.from_str(&"write" as &Char); +let static WRITE_SYMBOL: Symbol = write; +let append = Symbol.from_str(&"append" as &Char); +let static APPEND_SYMBOL: Symbol = append; +let copy = Symbol.from_str(&"cp" as &Char); +let static COPY_SYMBOL: Symbol = copy; +let remove = Symbol.from_str(&"rm" as &Char); +let static REMOVE_SYMBOL: Symbol = remove; +let make_dir = Symbol.from_str(&"mkdir" as &Char); +let static MAKE_DIR_SYMBOL: Symbol = make_dir; +let change_dir = Symbol.from_str(&"cd" as &Char); +let static CHANGE_DIR_SYMBOL: Symbol = change_dir; +let print_dir = Symbol.from_str(&"pwd" as &Char); +let static PRINT_DIR_SYMBOL: Symbol = print_dir; +let list_dir = Symbol.from_str(&"ls" as &Char); +let static LIST_DIR_SYMBOL: Symbol = list_dir; +let list_pid = Symbol.from_str(&"ps" as &Char); +let static LIST_PID_SYMBOL: Symbol = list_pid; +let list_mem = Symbol.from_str(&"mem" as &Char); +let static LIST_MEM_SYMBOL: Symbol = list_mem; +let help = Symbol.from_str(&"help" as &Char); +let static HELP_SYMBOL: Symbol = help; +let print_env = Symbol.from_str(&"env" as &Char); +let static PRINT_ENV_SYMBOL: Symbol = print_env; +let spawn = Symbol.from_str(&"run" as &Char); +let static SPAWN_SYMBOL: Symbol = spawn; +let clear = Symbol.from_str(&"clear" as &Char); +let static CLEAR_SYMBOL: Symbol = clear; + +enum Error { + PathNotFound(&Path), + ProcessSpawnFailed(&Path) +} + +impl Error { + def print(self: &Error) { + print("[Error] "); + match self { + &of PathNotFound(path) => { + print("path not found: "); + path.println(); + }, + _ => { + println("Error: Error.print() called with invalid error."); + } + } + } +} + + +impl Command { + def eval(self: &Command, env: &mut Env): Result<(), Error> { + env.disable_flush(); + print("Evaluating command: "); + self.print(); + println(); + let os = env.get_os(); + match self { + &of Clear => { + env.clear_screen(); + }, + &of Read(path) => { + let file = File.open(env.get_cwd(), FileMode of Read, env).expect(&"Could not open file." as &Char); + let text = file.read(env).expect(&"Could not read from file." as &Char); + // text.println(); + env.echo_coloredln(text.str(), Color.GREEN); + file.close(env).expect(&"Could not close file." as &Char); + }, + &of Write(path, text) => { + let file = File.open(env.get_cwd(), FileMode of Write, env).expect(&"Could not open file." as &Char); + file.write(text.str(), env).expect(&"Could not write to file." as &Char); + file.close(env).expect(&"Could not close file." as &Char); + }, + &of Append(path, text) => { + let file = File.open(env.get_cwd(), FileMode of Append, env).expect(&"Could not open file." as &Char); + file.write(text.str(), env).expect(&"Could not append to file." as &Char); + file.close(env).expect(&"Could not close file." as &Char); + }, + &of Copy(src, dst) => { + let src_path = Path.from_str(src.str()); + let dst_path = Path.from_str(dst.str()); + let src_file = File.open(&src_path, FileMode of Read, env).expect(&"Could not open source file." as &Char); + let dst_file = File.open(&dst_path, FileMode of Write, env).expect(&"Could not open destination file." as &Char); + let text = src_file.read(env).expect(&"Could not read from source file." as &Char); + dst_file.write(text.str(), env).expect(&"Could not write to destination file." as &Char); + src_file.close(env).expect(&"Could not close source file." as &Char); + dst_file.close(env).expect(&"Could not close destination file." as &Char); + }, + &of MakeDir(path) => { + let path = Path.from_str(path.str()); + File.create_dir(&path, env).expect(&"Could not create directory." as &Char); + }, + &of ChangeDir(mut name) => { + // env.get_cwd_mut().push(path); + let mut path = *(env.get_cwd()); + path.push(&mut name); + if os.change_dir(env, &path).is_ok() { + env.get_cwd_mut().copy_from(&path); + } else { + env.echo_coloredln(&"Could not change directory." as &Char, Color.RED); + } + }, + &of Spawn(mut name) => { + // let path = Path.from_str(path.str()); + let mut path = *(env.get_cwd()); + path.push(&mut name); + match os.spawn(env, &path) { + of Ok(pid) => { + // let mut str_buf = SmolString.from_str(&"Spawned process at " as &Char); + // str_buf.push_str(path.str()); + // // Add space + // str_buf.push_str(&" " as &Char); + env.echo_colored(&"Spawned process at " as &Char, Color.GREEN); + env.echo_coloredln(path.str(), Color.BLUE); + env.echo_colored(&"PID = " as &Char, Color.GREEN); + let pid_str = SmolString.from_int(pid); + env.echo_colored(pid_str.str(), Color.MAGENTA); + env.echo_coloredln(&"!" as &Char, Color.GREEN); + }, + of Err(e) => { + env.echo_coloredln(&"Could not spawn process!" as &Char, Color.RED); + } + } + }, + &of PrintDir => { + // env.get_cwd().println(); + env.echoln(env.get_cwd().str()); + }, + &of ListDir => { + // os.list_dir(env.get_cwd()); + File.list_dir(env.get_cwd(), env).expect(&"Could not list directory." as &Char); + // dir.close(os); + }, + &of ListPID => { + os.list_pid(env).expect(&"Could not list PIDs." as &Char); + }, + + &of ListMem => { + os.list_mem(env).expect(&"Could not list memory." as &Char); + }, + &of PrintEnv => { + env.print(); + // env.echo(&"Printing environment..." as &Char); + }, + &of Help(symbol) => { + if symbol.eq(&READ_SYMBOL) { + env.echoln(&"read " as &Char); + } elif symbol.eq(&WRITE_SYMBOL) { + env.echoln(&"write " as &Char); + } elif symbol.eq(&APPEND_SYMBOL) { + env.echoln(&"append " as &Char); + } elif symbol.eq(©_SYMBOL) { + env.echoln(&"cp " as &Char); + } elif symbol.eq(&MAKE_DIR_SYMBOL) { + env.echoln(&"mkdir " as &Char); + } elif symbol.eq(&CHANGE_DIR_SYMBOL) { + env.echoln(&"cd " as &Char); + } elif symbol.eq(&PRINT_DIR_SYMBOL) { + env.echoln(&"pwd" as &Char); + } elif symbol.eq(&LIST_DIR_SYMBOL) { + env.echoln(&"ls" as &Char); + } elif symbol.eq(&LIST_PID_SYMBOL) { + env.echoln(&"ps" as &Char); + } elif symbol.eq(&LIST_MEM_SYMBOL) { + env.echoln(&"mem" as &Char); + } elif symbol.eq(&PRINT_ENV_SYMBOL) { + env.echoln(&"env" as &Char); + } elif symbol.eq(&HELP_SYMBOL) { + env.echoln(&"help " as &Char); + } else { + env.echo_colored(&"Unknown help entry: " as &Char, Color.RED); + env.echoln(symbol.str()); + } + }, + + &of Invalid(s) => { + env.echo_colored(&"Invalid command: " as &Char, Color.RED); + env.echoln(s.str()); + }, + _ => { + env.echo_coloredln(&"Error: Command.eval() called with invalid command." as &Char, Color.RED); + // println("Error: Command.eval() called with invalid command."); + } + } + + return Result<(), Error> of Ok(()); + } + + def parse(s: &SmolString): Command { + match s.nth_symbol(0) { + of Some(program_str) => { + println("Found program: ", program_str.str()); + if program_str.eq(&PRINT_DIR_SYMBOL) { + Command of PrintDir; + } elif program_str.eq(&CLEAR_SYMBOL) { + Command of Clear; + } elif program_str.eq(&LIST_DIR_SYMBOL) { + Command of ListDir; + } elif program_str.eq(&LIST_PID_SYMBOL) { + Command of ListPID; + } elif program_str.eq(&LIST_MEM_SYMBOL) { + Command of ListMem; + } elif program_str.eq(&PRINT_ENV_SYMBOL) { + Command of PrintEnv; + } else { + match s.nth_symbol(1) { + of Some(arg_str) => { + println("Found argument: ", arg_str.str()); + if program_str.eq(©_SYMBOL) { + if let of Some(dst) = s.nth_symbol(2) { + Command of Copy(arg_str, dst); + } else { + Command of Invalid(*s); + } + } elif program_str.eq(&WRITE_SYMBOL) { + let mut s = *s; + s.trim_start(program_str.str()); + s.trim_whitespace(); + s.trim_start(arg_str.str()); + s.trim_whitespace(); + Command of Write(arg_str, s); + } elif program_str.eq(&APPEND_SYMBOL) { + let mut s = *s; + s.trim_start(program_str.str()); + s.trim_whitespace(); + s.trim_start(arg_str.str()); + s.trim_whitespace(); + Command of Append(arg_str, s); + } elif program_str.eq(&READ_SYMBOL) { + Command of Read(arg_str); + } elif program_str.eq(&MAKE_DIR_SYMBOL) { + Command of MakeDir(arg_str); + } elif program_str.eq(&SPAWN_SYMBOL) { + Command of Spawn(arg_str); + } elif program_str.eq(&CHANGE_DIR_SYMBOL) { + Command of ChangeDir(arg_str); + } elif program_str.eq(&HELP_SYMBOL) { + Command of Help(arg_str); + } else { + Command of Invalid(*s); + } + }, + _ => Command of Invalid(*s) + } + } + }, + _ => { + Command of Invalid(*s); + } + } + } + + def print(self: &Command) { + match self { + &of Read(path) => { + READ_SYMBOL.print(); + print(" "); + path.println(); + }, + &of Write(path, text) => { + WRITE_SYMBOL.print(); + print(" "); + path.print(); + print(" "); + text.println(); + }, + &of Append(path, text) => { + WRITE_SYMBOL.print(); + print(" "); + path.print(); + print(" "); + text.println(); + }, + &of Copy(src, dst) => { + COPY_SYMBOL.print(); + print(" "); + src.print(); + print(" "); + dst.println(); + }, + &of MakeDir(path) => { + MAKE_DIR_SYMBOL.print(); + print(" "); + path.println(); + }, + &of ChangeDir(path) => { + CHANGE_DIR_SYMBOL.print(); + print(" "); + path.println(); + }, + &of PrintDir => { + PRINT_DIR_SYMBOL.println(); + }, + &of ListDir => { + LIST_DIR_SYMBOL.println(); + }, + &of ListPID => { + LIST_PID_SYMBOL.println(); + }, + &of ListMem => { + LIST_MEM_SYMBOL.println(); + }, + &of PrintEnv => { + PRINT_ENV_SYMBOL.println(); + }, + &of Clear => { + CLEAR_SYMBOL.println(); + }, + &of Help(symbol) => { + HELP_SYMBOL.print(); + print(" "); + symbol.println(); + }, + &of Invalid(s) => { + print("Invalid command: "); + s.println(); + }, + _ => { + println("Error: Command.print() called with invalid command."); + } + } + } + + def echo(self: &Command, env: &mut Env) { + match self { + &of Read(path) => { + env.echo(READ_SYMBOL.str()); + env.echo_space(); + env.echoln(path.str()); + }, + &of Write(path, text) => { + env.echo(WRITE_SYMBOL.str()); + env.echo_space(); + env.echo(path.str()); + env.echo_space(); + env.echoln(text.str()); + }, + &of Append(path, text) => { + env.echo(APPEND_SYMBOL.str()); + env.echo_space(); + env.echo(path.str()); + env.echo_space(); + env.echoln(text.str()); + }, + &of Copy(src, dst) => { + env.echo(COPY_SYMBOL.str()); + env.echo_space(); + env.echo(src.str()); + env.echo_space(); + env.echoln(dst.str()); + }, + &of MakeDir(path) => { + env.echo(MAKE_DIR_SYMBOL.str()); + env.echo_space(); + env.echoln(path.str()); + }, + &of ChangeDir(path) => { + env.echo(CHANGE_DIR_SYMBOL.str()); + env.echo_space(); + env.echoln(path.str()); + }, + &of PrintDir => { + env.echoln(PRINT_DIR_SYMBOL.str()); + }, + &of ListDir => { + env.echoln(LIST_DIR_SYMBOL.str()); + }, + &of ListPID => { + env.echoln(LIST_PID_SYMBOL.str()); + }, + &of ListMem => { + env.echoln(LIST_MEM_SYMBOL.str()); + }, + &of PrintEnv => { + env.echoln(PRINT_ENV_SYMBOL.str()); + }, + &of Clear => { + env.echoln(CLEAR_SYMBOL.str()); + }, + &of Help(symbol) => { + env.echo(HELP_SYMBOL.str()); + env.echo_space(); + env.echoln(symbol.str()); + }, + &of Invalid(s) => { + env.echo(&"Invalid command: " as &Char); + env.echoln(s.str()); + }, + _ => { + println("Error: Command.print() called with invalid command."); + } + } + } + + def println(self: &Command) { + self.print(); + println(); + } +} + +let input_buf = calloc(1024); + +let mut screen = Screen.make({ x = 0, y = 0, width = 1280, height = 800 }, 2, 4); +when IS_RISCV {} +else { + screen = Screen.make({ x = 0, y = 0, width = 1280, height = 800 }, 2, 8); +} +screen.clear(Color.BLACK); + +def draw_logo(env: &mut Env) { + // Draw the "Sage Shell" logo on the screen. + + // A 2d array of the logo, with each number representing a certain shape. + let logo = [ + [0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 6, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 12, 3, 4, 5, 0, 0, 0, 0, 0], + [0, 0, 1, 1, 1, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 1, 1, 1, 0, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 0, 8, 0, 6, 7, 0, 0, 0, 0, 3, 5, 9, 5, 3, 0, 0, 0, 0, 0, 0], + [0, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 0, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 8, 6, 3, 6, 3, 0, 11, 3, 4, 5, 3, 4, 14, 0, 3, 4, 5, 9], + [0, 0, 2, 2, 2, 2, 1, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 2, 1, 1, 1, 0, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 6, 4, 3, 11, 9, 13, 0, 0, 3, 5, 4, 5, 9, 0, 3, 5, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 8, 13, 0, 9, 0, 3, 12, 9, 3, 5, 0, 0, 0], + [0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 0, 9, 13, 10, 8, 6, 3, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5, 13, 0, 6, 3, 6, 3, 5, 3, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4, 4, 5, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ]; + + // # Define a mapping of characters to integers + // char_to_int = { + // ' ': 0, # empty space + // '█': 1, # solid block + // '░': 2, # light block + // '.': 3, # dot + // '-': 4, # horizontal line + // '\'': 5, # single quote + // '`': 6, # backtick + // ',': 7, # comma + // '\\': 8, # backslash + // '/': 9, # forward slash + // '|': 10, # vertical bar + // ':': 11, # colon + // '_': 12, # underscore + // 'o': 13, # lowercase 'o' + // '=': 14, # equals sign + // } + for let mut row = 0; row < sizeof(logo) / sizeof(logo[0]); row += 1 { + for let mut col = 0; col < sizeof(logo[0]) / sizeof(logo[0][0]); col += 1 { + match logo[row][col] { + 0 => { + env.echo_colored(&" " as &Char, Color.BLACK); + }, + 1 => { + // env.echo_colored(&"█" as &Char, Color.GREEN); + env.echo_solid_block(Color.GREEN); + }, + 2 => { + // env.echo_colored(&"░" as &Char, Color.GREEN); + env.echo_light_block(Color.GREEN); + }, + 3 => { + env.echo_colored(&"." as &Char, Color.GREEN); + }, + 4 => { + env.echo_colored(&"-" as &Char, Color.GREEN); + }, + 5 => { + env.echo_colored(&"'" as &Char, Color.GREEN); + }, + 6 => { + env.echo_colored(&"`" as &Char, Color.GREEN); + }, + 7 => { + env.echo_colored(&"," as &Char, Color.GREEN); + }, + 8 => { + env.echo_colored(&"\\" as &Char, Color.GREEN); + }, + 9 => { + env.echo_colored(&"/" as &Char, Color.GREEN); + }, + 10 => { + env.echo_colored(&"|" as &Char, Color.GREEN); + }, + 11 => { + env.echo_colored(&":" as &Char, Color.GREEN); + }, + 12 => { + env.echo_colored(&"_" as &Char, Color.GREEN); + }, + 13 => { + env.echo_colored(&"o" as &Char, Color.GREEN); + }, + 14 => { + env.echo_colored(&"=" as &Char, Color.GREEN); + }, + other => { + println("Error: Invalid logo character = ", other); + env.echo_colored(&"?" as &Char, Color.RED); + } + } + } + // env.echo_newline(); + // env.echo_colored(&"\r\n" as &Char, Color.GREEN); + + env.echo_col = 0; + env.echo_colored(&"\r\n" as &Char, Color.GREEN); + } + env.echo_newline(); +} + + +let mut is_done = False; + +let mut env = Env.make(screen); +// let logo = Bitmap.SAGE_LOGO; +// env.echo_coloredln(&logo as &Char, Color.GREEN); +env.disable_flush(); +env.echo_coloredln(&"Welcome to the Sage Shell!" as &Char, Color.MAGENTA); +env.echo_colored(&"Go to " as &Char, Color.MAGENTA); +env.echo_colored(&"adam-mcdaniel.net/sage", Color.BLUE); +env.echo_coloredln(&"!" as &Char, Color.MAGENTA); +env.echo_newline(); + +draw_logo(&mut env); + +env.prompt(); + +while !is_done { + if env.read_line(input_buf) { + // env.echo_coloredln(input_buf, Color.YELLOW); + println("Read line: ", input_buf); + let s = SmolString.from_str(input_buf); + println("About to parse: ", s.str()); + let command = Command.parse(&s); + + command.eval(&mut env).expect(&"Error evaluating command." as &Char); + + env.prompt(); + } +} diff --git a/src/cli.rs b/src/cli.rs index 92cd1d63..ad77a7fc 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -53,7 +53,7 @@ enum TargetType { /// Compile to the standard variant of the virtual machine. StdVM, /// Compile to My OS source code (GCC only). - MyOS, + SageOS, /// Compile to C source code (GCC only). C, /// Compile to x86 assembly code. @@ -390,13 +390,13 @@ fn compile( .map_err(Error::InterpreterError)?; } }, - // If the target is MyOS source code, then compile the code to virtual machine code, - // and then use the MyOS target implementation to build the output source code. - TargetType::MyOS => write_file( + // If the target is SageOS source code, then compile the code to virtual machine code, + // and then use the SageOS target implementation to build the output source code. + TargetType::SageOS => write_file( format!("{output}.c"), match compile_source_to_vm(filename, src, src_type, call_stack_size)? { - Ok(vm_code) => targets::MyOS.build_core(&vm_code.flatten()), - Err(vm_code) => targets::MyOS.build_std(&vm_code.flatten()), + Ok(vm_code) => targets::SageOS.build_core(&vm_code.flatten()), + Err(vm_code) => targets::SageOS.build_std(&vm_code.flatten()), } .map_err(Error::BuildError)?, )?, diff --git a/src/lib.rs b/src/lib.rs index 21625db9..5bd2de0f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,8 +14,10 @@ //! ░░░░░░ //! ``` //! +//! ![Logo](https://github.com/adam-mcdaniel/sage/blob/main/assets/sage.png) +//! //! -//! ***(The sage compiler itself can be compiled to web assembly to be executed on the web. This allows a sage compiler + interpreter to be hosted on a static web page and run embded sage scripts. This web implementation compiles sage LIR code into sage virtual machine code, and then feeds it to a builtin virtual machine interpreter. The compiler can also switch to various backends, such as the C source code generator, or assembly output.)*** +//! ***(The sage compiler itself can be compiled to web assembly to be executed on the web. This allows a sage compiler + interpreter to be hosted on a static web page and run embedded sage scripts. This web implementation compiles sage LIR code into sage virtual machine code, and then feeds it to a builtin virtual machine interpreter. The compiler can also switch to various backends, such as the C source code generator, or assembly output.)*** //! //! This crate implements a compiler for the sage programming language //! and its low level virtual machine. diff --git a/src/targets/mod.rs b/src/targets/mod.rs index 01d96181..dd06bb59 100644 --- a/src/targets/mod.rs +++ b/src/targets/mod.rs @@ -39,8 +39,8 @@ pub mod c; pub use c::*; -pub mod my_os; -pub use my_os::*; +pub mod sage_os; +pub use sage_os::*; pub mod x86; pub use x86::*; diff --git a/src/targets/my_os.rs b/src/targets/sage_os.rs similarity index 99% rename from src/targets/my_os.rs rename to src/targets/sage_os.rs index 98fd9e13..09260d32 100644 --- a/src/targets/my_os.rs +++ b/src/targets/sage_os.rs @@ -24,9 +24,9 @@ use crate::{ /// The type for the C target which implements the `Target` trait. /// This allows the compiler to target the C language. #[derive(Default)] -pub struct MyOS; +pub struct SageOS; -impl Architecture for MyOS { +impl Architecture for SageOS { fn supports_input(&self, i: &Input) -> bool { matches!( i.mode, @@ -71,7 +71,7 @@ impl Architecture for MyOS { CoreOp::Div => "reg.i /= ptr->i;".to_string(), CoreOp::Rem => "reg.i %= ptr->i;".to_string(), CoreOp::IsNonNegative => "reg.i = reg.i >= 0;".to_string(), - _ => unreachable!("Invalid op for MyOS target {op:?}"), + _ => unreachable!("Invalid op for SageOS target {op:?}"), } } @@ -98,7 +98,7 @@ impl Architecture for MyOS { StandardOp::IsNonNegative => "reg.i = reg.f >= 0;".to_string(), StandardOp::Alloc => "reg.p = (cell*)salloc(reg.i * sizeof(reg));".to_string(), StandardOp::Free => "sfree((void*)reg.p);".to_string(), - _ => return Err(format!("Invalid standard op for MyOS target {op:?}")), + _ => return Err(format!("Invalid standard op for SageOS target {op:?}")), }) } @@ -975,4 +975,4 @@ void __get_tablet_event() { } } -impl CompiledTarget for MyOS {} +impl CompiledTarget for SageOS {}