MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / integer_literal

Function integer_literal

graphlite/src/ast/parser.rs:2545–2554  ·  view source on GitHub ↗

Parse integer literal

(tokens: &[Token])

Source from the content-addressed store, hash-verified

2543
2544/// Parse integer literal
2545fn integer_literal(tokens: &[Token]) -> IResult<&[Token], i64> {
2546 if let Some(Token::Integer(n)) = tokens.first() {
2547 Ok((&tokens[1..], *n))
2548 } else {
2549 Err(nom::Err::Error(nom::error::Error::new(
2550 tokens,
2551 nom::error::ErrorKind::Tag,
2552 )))
2553 }
2554}
2555
2556/// Parse float literal
2557fn float_literal(tokens: &[Token]) -> IResult<&[Token], f64> {

Callers

nothing calls this directly

Calls 2

ErrorEnum · 0.85
firstMethod · 0.45

Tested by

no test coverage detected