Address review comments

This commit is contained in:
Windel Bouwman committed 2018-08-26 22:01:00 +02:00
1 parent b8552a22e5
commit 3f7986c811
3 files changed
+12 -4

No files matched your search

+10 -2
View File
@@ -20,8 +20,8 @@ pub enum LexicalError {
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Location {
pub row: usize,
pub column: usize,
row: usize,
column: usize,
}
impl Location {
@@ -31,6 +31,14 @@ impl Location {
column: column,
}
}
pub fn get_row(&self) -> usize {
self.row
}
pub fn get_column(&self) -> usize {
self.column
}
}
pub type Spanned<Tok> = Result<(Location, Tok, Location), LexicalError>;
+1 -1
View File
@@ -223,7 +223,7 @@ fn builtin_isinstance(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
fn builtin_issubclass(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
if args.args.len() != 2 {
panic!("isinstance(s) expects exactly two parameters");
panic!("issubclass expects exactly two parameters");
}
let cls1 = args.args[0].clone();
+1 -1
View File
@@ -257,7 +257,7 @@ impl VirtualMachine {
trace!("Adding to traceback: {:?} {:?}", traceback, lineno);
let pos = self.ctx.new_tuple(vec![
self.ctx.new_str(filename.clone()),
self.ctx.new_int(lineno.row as i32),
self.ctx.new_int(lineno.get_row() as i32),
]);
objlist::append(
self,