-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
238691b
commit e27510a
Showing
4 changed files
with
27 additions
and
31 deletions.
There are no files selected for viewing
Submodule rain.string
updated
5 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,22 @@ | ||
// SPDX-License-Identifier: CAL | ||
// SPDX-License-Identifier: LicenseRef-DCL-1.0 | ||
// SPDX-FileCopyrightText: Copyright (c) 2020 thedavidmeister | ||
pragma solidity ^0.8.18; | ||
|
||
import {ParseState} from "../LibParseState.sol"; | ||
import { | ||
DecimalLiteralOverflow, | ||
ZeroLengthDecimal, | ||
MalformedExponentDigits, | ||
MalformedDecimalPoint, | ||
DecimalLiteralPrecisionLoss | ||
} from "../../../error/ErrParse.sol"; | ||
import { | ||
CMASK_E_NOTATION, | ||
CMASK_NUMERIC_0_9, | ||
CMASK_DECIMAL_POINT, | ||
CMASK_NEGATIVE_SIGN, | ||
CMASK_ZERO | ||
} from "rain.string/lib/parse/LibParseCMask.sol"; | ||
import {LibParseChar} from "rain.string/lib/parse/LibParseChar.sol"; | ||
import {LibParseDecimal} from "rain.string/lib/parse/LibParseDecimal.sol"; | ||
import {LibParseError} from "../LibParseError.sol"; | ||
import {LibParse} from "../LibParse.sol"; | ||
import {LibDecimalFloatImplementation, LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; | ||
import {LibParseDecimalFloat} from "rain.math.float/lib/parse/LibParseDecimalFloat.sol"; | ||
|
||
library LibParseLiteralDecimal { | ||
using LibParseError for ParseState; | ||
using LibParseLiteralDecimal for ParseState; | ||
|
||
function parseDecimalFloatPacked(ParseState memory state) internal view returns (LibDecimalFloat.Data memory) { | ||
LibDecimalFloat.Data memory result; | ||
result = self.parseDecimalFloat(); | ||
self.assertEnd(); | ||
return result; | ||
function parseDecimalFloatPacked(ParseState memory state, uint256 start, uint256 end) | ||
internal | ||
pure | ||
returns (uint256, uint256) | ||
{ | ||
(bytes4 errorSelector, uint256 cursor, uint256 packedFloat) = | ||
LibParseDecimalFloat.parseDecimalFloatPacked(start, end); | ||
state.handleErrorSelector(errorSelector, cursor); | ||
return (cursor, packedFloat); | ||
} | ||
|
||
|
||
} |