forked from AbleScript/ablescript
fmt
This commit is contained in:
parent
82767864ab
commit
f4beb85de2
|
@ -20,7 +20,7 @@ pub fn repl(ast_print: bool) {
|
||||||
println!("bye");
|
println!("bye");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut parser = Parser::new(line);
|
let mut parser = Parser::new(line);
|
||||||
let value = parser.init().and_then(|ast| {
|
let value = parser.init().and_then(|ast| {
|
||||||
if ast_print {
|
if ast_print {
|
||||||
|
|
|
@ -137,9 +137,9 @@ impl Value {
|
||||||
Rc::new(RefCell::new(match self {
|
Rc::new(RefCell::new(match self {
|
||||||
Value::Nul => Value::Nul,
|
Value::Nul => Value::Nul,
|
||||||
Value::Str(s) => Value::Int(s.as_bytes()[index.to_i32() as usize] as i32),
|
Value::Str(s) => Value::Int(s.as_bytes()[index.to_i32() as usize] as i32),
|
||||||
Value::Int(i) => Value::Int(
|
Value::Int(i) => {
|
||||||
(format!("{}", i).as_bytes()[index.to_i32() as usize] - b'0') as i32,
|
Value::Int((format!("{}", i).as_bytes()[index.to_i32() as usize] - b'0') as i32)
|
||||||
),
|
}
|
||||||
Value::Bool(b) => Value::Int(
|
Value::Bool(b) => Value::Int(
|
||||||
format!("{}", b)
|
format!("{}", b)
|
||||||
.chars()
|
.chars()
|
||||||
|
|
Loading…
Reference in a new issue