chore: reformatted all files
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from typing import BinaryIO, IO, Union
|
from typing import BinaryIO, IO, Union
|
||||||
|
|
||||||
from .unpacker import Unpacker
|
from .unpacker import Unpacker
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import collections
|
|||||||
import enum
|
import enum
|
||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
from typing import Dict, List, Optional, Union, Tuple
|
from typing import Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from pjvm.unpacker import Unpacker
|
from pjvm.unpacker import Unpacker
|
||||||
from .classloader import ClassLoader
|
from .classloader import ClassLoader
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from typing import Callable, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
|
from typing import Callable, Dict, List, Optional, TYPE_CHECKING, Tuple, Union
|
||||||
|
|
||||||
from . import utils
|
from . import utils
|
||||||
from .exceptions import PJVMTypeError, PJVMNotImplemented
|
from .exceptions import PJVMNotImplemented, PJVMTypeError
|
||||||
from .old_jtypes import JInteger, JObj, JString
|
from .old_jtypes import JInteger, JObj, JString
|
||||||
from .stackframe import Frame
|
from .stackframe import Frame
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import struct
|
import struct
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from .clazz import Class, Method, Code
|
from .clazz import Class, Code, Method
|
||||||
from .exceptions import PJVMException
|
from .exceptions import PJVMException
|
||||||
from .old_jtypes import JObj
|
from .old_jtypes import JObj
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ class Frame:
|
|||||||
raise PJVMException("Local out of bound!")
|
raise PJVMException("Local out of bound!")
|
||||||
self.local_variables[index] = val
|
self.local_variables[index] = val
|
||||||
|
|
||||||
def get_local(self, index: int) ->JObj:
|
def get_local(self, index: int) -> JObj:
|
||||||
if index > self.code.max_locals:
|
if index > self.code.max_locals:
|
||||||
raise PJVMException("Local out of bound!")
|
raise PJVMException("Local out of bound!")
|
||||||
val = self.local_variables[index]
|
val = self.local_variables[index]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from struct import unpack, calcsize
|
from struct import calcsize, unpack
|
||||||
from typing import Dict, BinaryIO
|
from typing import BinaryIO, Dict
|
||||||
|
|
||||||
|
|
||||||
class Unpacker:
|
class Unpacker:
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
re_types = re.compile('([BCDFIJSZV]|L(?:[a-zA-Z0-9_]+/)+[a-zA-Z0-9_]+;)')
|
re_types = re.compile('([BCDFIJSZV]|L(?:[a-zA-Z0-9_]+/)+[a-zA-Z0-9_]+;)')
|
||||||
|
|
||||||
re_method_sig = re.compile(fr"\(({re_types.pattern}*)\){re_types.pattern}")
|
re_method_sig = re.compile(fr"\(({re_types.pattern}*)\){re_types.pattern}")
|
||||||
|
|||||||
Reference in New Issue
Block a user