diff --git a/include/graphqlservice/internal/Grammar.h b/include/graphqlservice/internal/Grammar.h index 95ee999b..df0bf46a 100644 --- a/include/graphqlservice/internal/Grammar.h +++ b/include/graphqlservice/internal/Grammar.h @@ -234,8 +234,7 @@ struct exponent_part : if_must }; // https://spec.graphql.org/October2021/#FloatValue -struct float_value - : seq>> +struct float_value : seq>, exponent_part>> { }; diff --git a/test/PegtlExecutableTests.cpp b/test/PegtlExecutableTests.cpp index fe9c5bb6..3a010f73 100644 --- a/test/PegtlExecutableTests.cpp +++ b/test/PegtlExecutableTests.cpp @@ -229,4 +229,14 @@ TEST(PegtlExecutableCase, ParserDepthLimitExceeded) EXPECT_TRUE(caughtException) << "should catch a parse exception"; EXPECT_FALSE(parsedQuery) << "should not successfully parse the query"; +} + +TEST(PegtlExecutableCase, ParseFloatWithFractionalAndExponentialParts) +{ + memory_input<> input(R"gql({ field(value: 1.1e1) })gql", + "ParseFloatWithFractionalAndExponentialParts"); + + const bool result = parse(input); + + ASSERT_TRUE(result) << "we should be able to parse the doc"; } \ No newline at end of file