Skip to content

Instantly share code, notes, and snippets.

downloading Nix expressions from ‘https://d3g5gsiof5omrk.cloudfront.net/nixos/unstable/nixos-17.03pre101267.a9584c9/nixexprs.tar.xz’...
unpacking channels...
created 2 symlinks in user environment
these paths will be fetched (0.00 MiB download, 0.01 MiB unpacked):
/nix/store/7bi4d7691wqhk1649qvjq1qi3vd9a73m-nixos-rebuild
fetching path ‘/nix/store/7bi4d7691wqhk1649qvjq1qi3vd9a73m-nixos-rebuild’...
*** Downloading ‘https://cache.nixos.org/nar/0fw4a0qzzq0mgsld5sqparaz6gar79mp72izl4gs3l069znyl3bc.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/7bi4d7691wqhk1649qvjq1qi3vd9a73m-nixos-rebuild’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
building Nix...
building the system configuration...
these derivations will be built:
/nix/store/0h6ls3wxz0zdmx1w1cazpvr955b0w8kk-steam-runtime.json.drv
/nix/store/0nfdl4f572isprsxrdm7z7adx3jwbqv1-xlock.pam.drv
/nix/store/0qdlsk83y66kgxy14gs0cyzblpsrvih3-unit-remote-fs.target.drv
/nix/store/1d9h2rk45wzrr0fx2pix1mr6vq9g776f-skype-4.3.0.37.drv
/nix/store/1fda4j81hdw6j603y6s9l062ilpfg4rs-udev-rules.drv
/nix/store/1h8w0kn0v6vyvbyf1jw2x21fmmslghv3-runuser-l.pam.drv
/nix/store/1j490ki62jaw4lbrvldr1cw2yqbn8hjs-unit-systemd-logind.service.drv
use std::collections::VecDeque;
use std::str::FromStr;
#[derive(Debug, Clone)]
enum OperatorToken {
Plus,
Minus,
Multiply,
Divide,
}
No Makefile; skipping clean.
Removing aclocal.m4
Removing autom4te.cache/
Removing build-aux/ar-lib
Removing build-aux/config.guess
Removing build-aux/config.sub
Removing build-aux/depcomp
Removing build-aux/install-sh
Removing build-aux/missing
Removing configure
travisbhartwell@bashombp:~/Projects/rbasic$ cargo build
Compiling either v1.0.2
Compiling itertools v0.5.8
Compiling rbasic v0.1.0 (file:///Users/travisbhartwell/Projects/rbasic)
error[E0432]: unresolved import `itertools::Itertools`
--> src/lexer.rs:2:5
|
2 | use itertools::Itertools;
| ^^^^^^^^^^^^^^^^^^^^ Did you mean `self::itertools`?
use std::str::FromStr;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct LineNumber(pub u32);
#[derive(Debug, Clone, PartialEq)]
pub enum Token {
Comment(String),
// Variables and Literals
pub fn tokenize_line(line: &str) -> Result<LineOfCode, String> {
let mut char_iter = line.chars().enumerate().peekable();
let mut line_number = LineNumber(0);
let mut tokens: Vec<(u16, Token)> = Vec::new();
while char_iter.peek() != None {
let cur = char_iter.next();
if cur.is_some() {
let (pos, ch) = cur.unwrap();
// 5 REM inputting the argument
// 10 PRINT " factorial of:"
// 20 INPUT A
// 30 LET B = 1
// 35 REM beginning of the loop
// 40 IF A <= 1 THEN 80
// 50 LET B = B * A
// 60 LET A = A - 1
// 70 GOTO 40
// 75 REM prints the result
// 5 REM inputting the argument
// 10 PRINT " factorial of:"
// 20 INPUT A
// 30 LET B = 1
// 35 REM beginning of the loop
// 40 IF A <= 1 THEN 80
// 50 LET B = B * A
// 60 LET A = A - 1
// 70 GOTO 40
// 75 REM prints the result
(setq-default org2jekyll-blog-author "ardumont"
org2jekyll-source-directory (expand-file-name "~/org/")
org2jekyll-jekyll-directory (expand-file-name "~/public_html/")
org2jekyll-jekyll-drafts-dir ""
org2jekyll-jekyll-posts-dir "_posts/"
org-publish-project-alist
`(("default"
:base-directory ,(org2jekyll-input-directory)
:base-extension "org"
:publishing-directory ,(org2jekyll-output-directory)