diff options
Diffstat (limited to 'lib/Parser/Parser.cc')
| -rw-r--r-- | lib/Parser/Parser.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Parser/Parser.cc b/lib/Parser/Parser.cc index 36b0a6a..26eeac6 100644 --- a/lib/Parser/Parser.cc +++ b/lib/Parser/Parser.cc @@ -231,6 +231,12 @@ std::unique_ptr<StmtAST> Parser::ParseAssignStmt() { std::vector<DesignatorAccess> Accesses; if (!ParseDesignatorSuffix(Accesses)) return nullptr; + if (CurTok == '(') { + auto Call = ParseMemberCall(Name, std::move(Accesses), Line); + if (!Call) return nullptr; + return std::make_unique<MemberCallStmtAST>(std::move(Call)); + } + if (CurTok != tok_assign) { fprintf(stderr, "error: Expected '<-' after identifier '%s' at line %d\n", Name.c_str(), Line); return nullptr; |
