Skip to content

Commit

Permalink
length
Browse files Browse the repository at this point in the history
  • Loading branch information
sozysozbot committed Jul 27, 2020
1 parent 6f079d3 commit 0e90f21
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,15 @@ fn parse_assign_after_zhe3(mut iter: &mut LexIter<'_>) -> Result<Rvalue, Error>
Err(Error::SomethingWentWrong(here!()))
}

} // not in spec.html but I believe it exists
} // not in spec.html but it exists
lex::Lex::Chang2 => {
if let lex::Lex::Shi4Yi3 = iter.next().ok_or(Error::UnexpectedEOF)? {
Ok(Rvalue::Length(data))
} else {
Err(Error::SomethingWentWrong(here!()))
}

} // not in spec.html but it exists
_ => Err(Error::SomethingWentWrong(here!())),
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ fn test086() {
fn test087() {
test("test087")
}
#[test]
fn test088() {
test("test088")
}
/// note that fail000.rs currently does not compile as a valid Rust program because of:
/// * `{}` on `Vec<f64>`
/// * ownership
Expand Down
7 changes: 7 additions & 0 deletions test088.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main() {
let mut JIA3 = vec![];
JIA3.push(3.0);
JIA3.push(5.0);
let mut YI3 = 1.0;
YI3 = (JIA3.len() as f64);
}
3 changes: 3 additions & 0 deletions test088.wy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
吾有一列。名之曰「甲」。充「甲」以三。充「甲」以五。
有數一。名之曰「乙」。
昔之「乙」者今「甲」之長是矣

0 comments on commit 0e90f21

Please sign in to comment.