Function tagua_parser::rules::literals::decimal []

pub fn decimal(i: &[u8]) -> IResult<&[u8]Literalu32>

Recognize an integer with the decimal notation.

If the integer is too large to fit in an i64, then it will be a f64.

Examples

use tagua_parser::Result;
use tagua_parser::ast::Literal;
use tagua_parser::rules::literals::decimal;

assert_eq!(decimal(b"42"), Result::Done(&b""[..], Literal::Integer(42i64)));Run