Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Aug 24, 2024
1 parent 165de4c commit 2fe8963
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 608 deletions.
1 change: 0 additions & 1 deletion src/concrete/extern/RainterpreterReferenceExternNPE2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {
OPCODE_FUNCTION_POINTERS
} from "../../generated/RainterpreterReferenceExternNPE2.pointers.sol";
import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol";
import {console2} from "forge-std/Test.sol";

/// @dev The number of subparser functions available to the parser. This is NOT
/// 1:1 with the number of opcodes provided by the extern component of this
Expand Down
83 changes: 0 additions & 83 deletions src/lib/parse/literal/LibParseLiteralDecimal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -216,87 +216,4 @@ library LibParseLiteralDecimal {
}
}
}

// /// Returns cursor after, value
// function parseDecimal(ParseState memory state, uint256 cursor, uint256 end)
// internal
// pure
// returns (uint256, uint256)
// {
// uint256 fracOffset = 0;
// uint256 fracValue = 0;
// uint256 scale = 0;
// uint256 intValue = 0;

// unchecked {
// {
// uint256 start = cursor;
// cursor = LibParse.skipMask(cursor, end, CMASK_NUMERIC_0_9);
// if (cursor == start) {
// revert ZeroLengthDecimal(state.parseErrorOffset(cursor));
// }
// intValue = state.unsafeStrToInt(start, cursor);
// }

// uint256 isFrac = LibParse.isMask(cursor, end, CMASK_DECIMAL_POINT);
// if (isFrac == 1) {
// cursor++;
// uint256 fracStart = cursor;
// cursor = LibParse.skipMask(cursor, end, CMASK_NUMERIC_0_9);
// if (cursor == fracStart) {
// revert MalformedDecimalPoint(state.parseErrorOffset(cursor));
// }

// // Trailing zeros are allowed in fractional literals but should
// // not be counted in the precision.
// uint256 nonZeroCursor = cursor;
// while (LibParse.isMask(nonZeroCursor - 1, end, CMASK_ZERO) == 1) {
// nonZeroCursor--;
// }

// fracValue = state.unsafeStrToInt(fracStart, nonZeroCursor);
// fracOffset = nonZeroCursor - fracStart;
// }

// uint256 eValue = 0;
// uint256 eNeg = 0;
// if (LibParse.isMask(cursor, end, CMASK_E_NOTATION) > 0) {
// cursor++;
// eNeg = LibParse.isMask(cursor, end, CMASK_NEGATIVE_SIGN);
// cursor += eNeg;

// uint256 eStart = cursor;
// cursor = LibParse.skipMask(cursor, end, CMASK_NUMERIC_0_9);
// if (cursor == eStart) {
// revert MalformedExponentDigits(state.parseErrorOffset(cursor));
// }
// eValue = state.unsafeStrToInt(eStart, cursor);
// }

// {
// // If this is a fractional number, then we need to scale it up to
// // 1e18 being "one". Otherwise we treat as an integer.
// if (eNeg > 0) {
// if (DECIMAL_SCALE < eValue) {
// revert DecimalLiteralPrecisionLoss(state.parseErrorOffset(cursor));
// }
// scale = DECIMAL_SCALE - eValue;
// } else {
// scale = DECIMAL_SCALE + eValue;
// }
// }

// if (scale >= 77) {
// revert DecimalLiteralOverflow(state.parseErrorOffset(cursor));
// }

// if (scale < fracOffset) {
// revert DecimalLiteralPrecisionLoss(state.parseErrorOffset(cursor));
// }
// }

// // Do this bit with checked math in case we missed an edge case above
// // that causes overflow.
// return (cursor, intValue * (10 ** scale) + fracValue * (10 ** (scale - fracOffset)));
// }
}
Loading

0 comments on commit 2fe8963

Please sign in to comment.