Skip to content

Commit f671c66

Browse files
authored
Merge pull request #307 from wravery/fix-306
2 parents aa02e66 + 29f729b commit f671c66

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

include/graphqlservice/internal/Grammar.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ struct exponent_part : if_must<exponent_indicator, exponent_part_content>
234234
};
235235

236236
// https://spec.graphql.org/October2021/#FloatValue
237-
struct float_value
238-
: seq<integer_part, sor<fractional_part, exponent_part, seq<fractional_part, exponent_part>>>
237+
struct float_value : seq<integer_part, sor<seq<fractional_part, opt<exponent_part>>, exponent_part>>
239238
{
240239
};
241240

test/PegtlExecutableTests.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,14 @@ TEST(PegtlExecutableCase, ParserDepthLimitExceeded)
229229

230230
EXPECT_TRUE(caughtException) << "should catch a parse exception";
231231
EXPECT_FALSE(parsedQuery) << "should not successfully parse the query";
232+
}
233+
234+
TEST(PegtlExecutableCase, ParseFloatWithFractionalAndExponentialParts)
235+
{
236+
memory_input<> input(R"gql({ field(value: 1.1e1) })gql",
237+
"ParseFloatWithFractionalAndExponentialParts");
238+
239+
const bool result = parse<executable_document>(input);
240+
241+
ASSERT_TRUE(result) << "we should be able to parse the doc";
232242
}

0 commit comments

Comments
 (0)