From 2dcc3665abf57c3607cebffdeeca062f5894885d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 1 Aug 2019 08:38:30 +0200 Subject: deps: update V8 to 7.6.303.28 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/28016 Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann (רפאל פלחי) Reviewed-By: Rich Trott Reviewed-By: Michael Dawson Reviewed-By: Jiawen Geng --- deps/v8/src/torque/earley-parser.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'deps/v8/src/torque/earley-parser.h') diff --git a/deps/v8/src/torque/earley-parser.h b/deps/v8/src/torque/earley-parser.h index 16d3e92571..9d9cfb02c0 100644 --- a/deps/v8/src/torque/earley-parser.h +++ b/deps/v8/src/torque/earley-parser.h @@ -54,6 +54,8 @@ enum class ParseResultHolderBase::TypeId { kOptionalLabelBlockPtr, kNameAndTypeExpression, kNameAndExpression, + kConditionalAnnotation, + kOptionalConditionalAnnotation, kClassFieldExpression, kStructFieldExpression, kStdVectorOfNameAndTypeExpression, @@ -64,6 +66,7 @@ enum class ParseResultHolderBase::TypeId { kOptionalStdString, kStdVectorOfStatementPtr, kStdVectorOfDeclarationPtr, + kStdVectorOfStdVectorOfDeclarationPtr, kStdVectorOfExpressionPtr, kExpressionWithSource, kParameterList, @@ -189,6 +192,15 @@ inline base::Optional DefaultAction( return child_results->Next(); } +template +inline Action AsSingletonVector() { + return [](ParseResultIterator* child_results) -> base::Optional { + auto result = action(child_results); + if (!result) return result; + return ParseResult{std::vector{(*result).Cast()}}; + }; +} + // A rule of the context-free grammar. Each rule can have an action attached to // it, which is executed after the parsing is finished. class Rule final { @@ -303,10 +315,13 @@ class Item { void CheckAmbiguity(const Item& other, const LexerResult& tokens) const; MatchedInput GetMatchedInput(const LexerResult& tokens) const { - return {tokens.token_contents[start_].begin, - start_ == pos_ ? tokens.token_contents[start_].begin - : tokens.token_contents[pos_ - 1].end, - tokens.token_contents[start_].pos}; + const MatchedInput& start = tokens.token_contents[start_]; + const MatchedInput& end = start_ == pos_ ? tokens.token_contents[start_] + : tokens.token_contents[pos_ - 1]; + CHECK_EQ(start.pos.source, end.pos.source); + SourcePosition combined{start.pos.source, start.pos.start, end.pos.end}; + + return {start.begin, end.end, combined}; } // We exclude {prev_} and {child_} from equality and hash computations, -- cgit v1.2.1