An update!
Just minor tweaks and slight updates.
This commit is contained in:
parent
1cc7b2ec6c
commit
aaf6455762
4 changed files with 21 additions and 50 deletions
26
README.md
26
README.md
|
@ -1,14 +1,13 @@
|
||||||
# Corten
|
# Corten
|
||||||
|
|
||||||
Corten is a RISC virtual machine written in Rust as a hobby and based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial.
|
Corten is a RISC-V virtual machine written in Rust as a hobby and based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial.
|
||||||
|
|
||||||
## Build Status
|
## Build Status
|
||||||
|
|
||||||
| Service | Status |
|
| Service | Status |
|
||||||
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||||
| Github |  |
|
| Github |  |
|
||||||
| Travis CI | [](https://travis-ci.org/tonytins/corten) |
|
| Travis CI | [](https://travis-ci.org/tonytins/corten) |
|
||||||
| AppVeyor | [](https://ci.appveyor.com/project/tonytins/corten) |
|
|
||||||
|
|
||||||
## Specifications
|
## Specifications
|
||||||
|
|
||||||
|
@ -21,20 +20,7 @@ See [specifications](docs/spec.md) page.
|
||||||
- Rust 1.41+
|
- Rust 1.41+
|
||||||
- Recommended IDEs
|
- Recommended IDEs
|
||||||
- Visual Studio Code
|
- Visual Studio Code
|
||||||
- Jetbrains IntelliJ
|
- Jetbrains IntelliJ or CLion
|
||||||
|
|
||||||
### Supported Platforms
|
|
||||||
|
|
||||||
- Ubuntu 18.04+
|
|
||||||
- Windows 10 v1809+
|
|
||||||
- macOS 10.15+
|
|
||||||
|
|
||||||
## Authors
|
|
||||||
|
|
||||||
- **Anthony Foxclaw** - *Initial work* - [tonytins](https://github.com/tonytins)
|
|
||||||
- **Fletcher Haynes** - *Tutorial* - [fletchercp](https://gitlab.com/fletchercp)
|
|
||||||
|
|
||||||
See also the list of [contributors](https://github.com/tonytins/simtactics/contributors) who participated in this project.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,11 @@
|
||||||
# Welcome
|
# Welcome
|
||||||
|
|
||||||
Corten is a RISC virtual machine written in Rust as a hobby and based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial.
|
Corten is a RISC-V virtual machine written in Rust as a hobby and based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial.
|
||||||
|
|
||||||
## Specifications
|
## Specifications
|
||||||
|
|
||||||
See [specifications](spec.md) page.
|
See [specifications](spec.md) page.
|
||||||
|
|
||||||
## Build Status
|
|
||||||
|
|
||||||
| Service | Status |
|
|
||||||
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| Github |  |
|
|
||||||
| Travis CI | [](https://travis-ci.org/tonytins/corten) |
|
|
||||||
| AppVeyor | [](https://ci.appveyor.com/project/tonytins/corten) |
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
### Supported Platforms
|
|
||||||
|
|
||||||
- Ubuntu 18.04+
|
|
||||||
- Windows 10 v1809+
|
|
||||||
- macOS 10.15+
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the MPL 2.0 license - see the [LICENSE](LICENSE) file for details.
|
This project is licensed under the MPL 2.0 license - see the [LICENSE](LICENSE) file for details.
|
|
@ -15,6 +15,7 @@ pub enum Token {
|
||||||
Number { value: i32 },
|
Number { value: i32 },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RISC-V opcodes
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub enum Opcode {
|
pub enum Opcode {
|
||||||
HLT,
|
HLT,
|
||||||
|
|
|
@ -17,18 +17,18 @@ named!(pub opcode<CompleteStr, Token>,
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod opcode_parser_test {
|
mod opcode_parser_test {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parser_op_load() {
|
fn test_parser_op_load() {
|
||||||
// Test that opcode is dected and parsed correctly
|
// Test that opcode is detected and parsed correctly
|
||||||
let result = opcode(CompleteStr("load"));
|
let result = opcode(CompleteStr("load"));
|
||||||
assert_eq!(result.is_ok(), true);
|
assert_eq!(result.is_ok(), true);
|
||||||
let (rest, token) = result.unwrap();
|
let (rest, token) = result.unwrap();
|
||||||
assert_eq!(token, Token::Opcode { code: Opcode::LOAD });
|
assert_eq!(token, Token::Opcode { code: Opcode::LOAD });
|
||||||
assert_eq!(rest, CompleteStr(""));
|
assert_eq!(rest, CompleteStr(""));
|
||||||
let result = opcode(CompleteStr("alod"));
|
let result = opcode(CompleteStr("alod"));
|
||||||
let (_, token) = result.unwrap();
|
let (_, token) = result.unwrap();
|
||||||
assert_eq!(token, Token::Opcode { code: Opcode::IGL });
|
assert_eq!(token, Token::Opcode { code: Opcode::IGL });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue