mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-12 23:55:21 +00:00
Custom marshal enc/decoding impl
This commit is contained in:
parent
50b5388711
commit
41b465dee1
14 changed files with 913 additions and 229 deletions
|
@ -249,9 +249,9 @@ impl Compiler {
|
|||
fn push_output(
|
||||
&mut self,
|
||||
flags: bytecode::CodeFlags,
|
||||
posonlyarg_count: usize,
|
||||
arg_count: usize,
|
||||
kwonlyarg_count: usize,
|
||||
posonlyarg_count: u32,
|
||||
arg_count: u32,
|
||||
kwonlyarg_count: u32,
|
||||
obj_name: String,
|
||||
) {
|
||||
let source_path = self.source_path.clone();
|
||||
|
@ -936,9 +936,11 @@ impl Compiler {
|
|||
|
||||
self.push_output(
|
||||
bytecode::CodeFlags::NEW_LOCALS | bytecode::CodeFlags::IS_OPTIMIZED,
|
||||
args.posonlyargs.len(),
|
||||
args.posonlyargs.len() + args.args.len(),
|
||||
args.kwonlyargs.len(),
|
||||
args.posonlyargs.len().try_into().unwrap(),
|
||||
(args.posonlyargs.len() + args.args.len())
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
args.kwonlyargs.len().try_into().unwrap(),
|
||||
name.to_owned(),
|
||||
);
|
||||
|
||||
|
@ -2750,8 +2752,8 @@ impl Compiler {
|
|||
self.current_source_location = location;
|
||||
}
|
||||
|
||||
fn get_source_line_number(&self) -> usize {
|
||||
self.current_source_location.row()
|
||||
fn get_source_line_number(&self) -> u32 {
|
||||
self.current_source_location.row() as u32
|
||||
}
|
||||
|
||||
fn push_qualified_path(&mut self, name: &str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue