Skip to content

Commit f418de7

Browse files
authored
Add editing mode to fungoid ide (#14)
1 parent 5419cc4 commit f418de7

File tree

20 files changed

+546
-236
lines changed

20 files changed

+546
-236
lines changed

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- master
77
pull_request:
88

9+
env:
10+
CARGO_TERM_COLOR: always
11+
912
jobs:
1013
pre-commit:
1114
strategy:
@@ -16,12 +19,17 @@ jobs:
1619
runs-on: ubuntu-latest
1720

1821
steps:
19-
- uses: actions/checkout@v3.0.2
20-
- uses: actions-rs/toolchain@v1.0.7
22+
- name: Checkout repository
23+
uses: actions/checkout@v3.0.2
24+
- name: Set up Rust toolchain
25+
uses: actions-rs/toolchain@v1.0.7
2126
with:
2227
toolchain: ${{ matrix.toolchain }}
2328
override: true
24-
- uses: actions/setup-python@v4.0.0
29+
components: rustfmt, clippy
30+
- name: Set up Python
31+
uses: actions/setup-python@v4.0.0
2532
with:
2633
python-version: "3.x"
27-
- uses: pre-commit/action@v3.0.0
34+
- name: Run pre-commit
35+
uses: pre-commit/action@v3.0.0

.github/workflows/publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@ on:
44
release:
55
types: [ published ]
66

7+
env:
8+
CARGO_TERM_COLOR: always
9+
710
jobs:
811
publish:
912
runs-on: ubuntu-latest
1013

1114
steps:
12-
- uses: actions/checkout@v3.0.2
13-
- uses: actions-rs/toolchain@v1.0.7
15+
- name: Checkout repository
16+
uses: actions/checkout@v3.0.2
17+
- name: Set up Rust toolchain
18+
uses: actions-rs/toolchain@v1.0.7
1419
with:
1520
toolchain: stable
1621
override: true
17-
- uses: actions-rs/cargo@v1.0.3
22+
- name: Publish crate
23+
uses: actions-rs/cargo@v1.0.3
1824
with:
1925
command: publish
2026
args: --token ${{ secrets.CRATES_TOKEN }}

.github/workflows/tests.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
platform: [ ubuntu-latest, macos-latest, windows-latest ]
18-
toolchain: [ stable ]
18+
toolchain: [ stable, nightly ]
1919

2020
runs-on: ${{ matrix.platform }}
2121

2222
steps:
23-
- uses: actions/checkout@v3.0.2
24-
- uses: actions-rs/toolchain@v1.0.7
23+
- name: Checkout repository
24+
uses: actions/checkout@v3.0.2
25+
- name: Set up Rust toolchain
26+
uses: actions-rs/toolchain@v1.0.7
2527
with:
2628
toolchain: ${{ matrix.toolchain }}
2729
override: true
28-
- uses: actions-rs/cargo@v1.0.3
30+
components: rustfmt, clippy
31+
- name: Build
32+
uses: actions-rs/cargo@v1.0.3
2933
with:
3034
command: build
31-
args: --verbose --release
32-
- uses: actions-rs/cargo@v1.0.3
35+
args: --verbose
36+
- name: Test
37+
uses: actions-rs/cargo@v1.0.3
3338
with:
3439
command: test
35-
args: --verbose --release
40+
args: --verbose --no-fail-fast

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
## 0.2.1
4+
5+
### Added
6+
7+
- IDE mode now allows editing of the program.
8+
- A set of example programs is now bundled into the `fungoid` executable.
9+
Run `fungoid examples` to see the `NAME`s of the examples,
10+
and `fungoid run example:NAME` or `fungoid ide example:NAME` to execute them.
11+
12+
### Changed
13+
14+
- Errors during program execution now return `Result`s instead of panicking.
15+
16+
## 0.2.0
17+
18+
### Added
19+
20+
- Added IDE mode (`fungoid ide FILE`), with visual execution of programs.

Cargo.lock

Lines changed: 23 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fungoid"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "A Befunge interpreter and IDE"
55
authors = ["Josh Karpel <josh.karpel@gmail.com>"]
66
edition = '2018'
@@ -19,3 +19,4 @@ rand = "0.8.5"
1919
separator = "0.4.1"
2020
tui = "0.18.0"
2121
itertools = "0.10.3"
22+
lazy_static = "1.4.0"

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,13 @@
22

33
![Tests](https://github.com/JoshKarpel/fungoid/workflows/tests/badge.svg)
44

5-
A Befunge interpreter written in Rust
5+
A Befunge interpreter written in Rust.
6+
7+
## Installation
8+
9+
`fungoid` can be installed using
10+
[`cargo`, the Rust package manager](https://doc.rust-lang.org/cargo/):
11+
12+
```bash
13+
$ cargo install fungoid
14+
```

rustfmt.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
unstable_features = true
2+
3+
imports_granularity = "Crate"
4+
group_imports = "StdExternalCrate"
5+
6+
combine_control_expr = false
7+
8+
reorder_impl_items = true

src/examples.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use std::collections::HashMap;
2+
3+
pub const DNA: &str = include_str!("examples/dna.bf");
4+
pub const ERATOSTHENES: &str = include_str!("examples/eratosthenes.bf");
5+
pub const FACTORIAL: &str = include_str!("examples/factorial.bf");
6+
pub const HELLO_WORLD: &str = include_str!("examples/hello_world.bf");
7+
pub const INPUT: &str = include_str!("examples/input.bf");
8+
pub const QUINE: &str = include_str!("examples/quine.bf");
9+
pub const RNG: &str = include_str!("examples/rng.bf");
10+
11+
lazy_static! {
12+
pub static ref EXAMPLES: HashMap<&'static str, &'static str> = {
13+
let mut m = HashMap::new();
14+
m.insert("dna", DNA);
15+
m.insert("eratosthenes", ERATOSTHENES);
16+
m.insert("factorial", FACTORIAL);
17+
m.insert("hello_world", HELLO_WORLD);
18+
m.insert("input", INPUT);
19+
m.insert("quine", QUINE);
20+
m.insert("rng", RNG);
21+
m
22+
};
23+
}
File renamed without changes.

0 commit comments

Comments
 (0)