renamed decimal to real
This commit is contained in:
1 parent
472942867b
commit
da936e6a48
3 files changed
+15
-15
No files matched your search
@@ -3,7 +3,7 @@ from typing import Optional
|
||||
from pdfmajor.streambuffer import BufferStream
|
||||
from pdfmajor.lexer.exceptions import InvalidToken, LexerEOF, LexerError
|
||||
from pdfmajor.lexer.token import (
|
||||
TokenDecimal,
|
||||
TokenReal,
|
||||
TokenNumber,
|
||||
TokenInteger,
|
||||
)
|
||||
@@ -46,7 +46,7 @@ def parse_number(
|
||||
buffer.seek(pos + j)
|
||||
try:
|
||||
if is_decimal:
|
||||
return TokenDecimal(
|
||||
return TokenReal(
|
||||
initialpos,
|
||||
buffer.tell(),
|
||||
Decimal(curtoken.decode()),
|
||||
|
||||
@@ -8,7 +8,7 @@ T = TypeVar("T")
|
||||
class Token(Generic[T]):
|
||||
"""A generic class representing PDF Token"""
|
||||
|
||||
__slots__ = ["pos", "size", "value"]
|
||||
__slots__ = ["start_loc", "end_loc", "value"]
|
||||
|
||||
def __init__(self, start_loc: int, end_loc: int, value: T) -> None:
|
||||
self.start_loc = start_loc
|
||||
@@ -86,21 +86,21 @@ class TokenHexString(Token[bytes]):
|
||||
|
||||
class TokenInteger(Token[int]):
|
||||
"""Token representing PDF integers
|
||||
Detection of this type of token can be found in PDF 1.7
|
||||
Detection of this type of token can be found in PDF 1.7 spec section 7.3.3
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TokenDecimal(Token[Decimal]):
|
||||
class TokenReal(Token[Decimal]):
|
||||
"""Token representing PDF decimals
|
||||
Detection of this type of token can be found in PDF 1.7
|
||||
Detection of this type of token can be found in PDF 1.7 spec section 7.3.3
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
TokenNumber = Union[TokenInteger, TokenDecimal]
|
||||
TokenNumber = Union[TokenInteger, TokenReal]
|
||||
|
||||
|
||||
class TDictValue(Enum):
|
||||
|
||||
Reference in new issue
Block a user