jroesch commented on a change in pull request #6162:
URL: https://github.com/apache/incubator-tvm/pull/6162#discussion_r467340470
##########
File path: src/parser/parser.cc
##########
@@ -1231,14 +1335,38 @@ class Parser {
}
}
default: {
- std::stringstream msg;
- msg << "expected an expression found " << Pretty(next->token_type);
- diag_ctx.Emit({next->line, next->column, msg.str()});
- diag_ctx.Render(std::cout);
+ this->diag_ctx->EmitFatal(DiagnosticBuilder(DiagnosticLevel::Error,
next->span)
+ << "expected an expression found "
+ << Pretty(next->token_type));
return Expr();
}
}
});
+
+ if (WhenMatch(TokenType::Period)) {
+ auto index = Match(TokenType::Integer).ToNumber();
+ expr = relay::TupleGetItem(expr, index);
+ }
+
+ return expr;
+ }
+
+ /*! \brief Parse a hierarchical name. */
+ Array<String> ParseHierName() {
Review comment:
Yeah I will document this, was quickly hacking up with Jason on the
stream in order to unblock, worth coming back to it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]