Add Rust target
This commit is contained in:
1 parent
5fc712c6ee
commit
89f1f84857
64 files changed
+3441
-27
No files matched your search
@@ -0,0 +1,27 @@
|
||||
use testparser::*;
|
||||
|
||||
fn main() {
|
||||
let input = b"abbccc";
|
||||
let mut context = p_context_new(input);
|
||||
assert_eq!(P_SUCCESS, p_parse(&mut context));
|
||||
{
|
||||
let start = p_result(&context);
|
||||
let t1 = start.pT1();
|
||||
let t2 = start.pT2();
|
||||
let t3 = start.pT3();
|
||||
assert_eq!(1, t1.position().col);
|
||||
assert_eq!(1, t1.end_position().col);
|
||||
assert_eq!(2, t2.position().col);
|
||||
assert_eq!(3, t2.end_position().col);
|
||||
assert_eq!(4, t3.position().col);
|
||||
assert_eq!(6, t3.end_position().col);
|
||||
/* Token node position within T1. */
|
||||
assert_eq!(1, t1.pToken().position().col);
|
||||
/* Overall start node spans the whole input. */
|
||||
assert_eq!(1, start.position().col);
|
||||
assert_eq!(6, start.end_position().col);
|
||||
assert_eq!(3, start.n_fields());
|
||||
}
|
||||
p_context_delete(context);
|
||||
println!("ok");
|
||||
}
|
||||
Reference in new issue
Block a user