mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 17:13:16 +01:00
The presence or absence of whitespace is used to determine which operator is in use, following the rules described in #520. Support for prefix * dereference operator follows #523. Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
committed by
GitHub
co-authored by
Geoff Romer
parent
d6b47ba10f
commit
89e21113c3
@@ -537,6 +537,7 @@ TEST_F(ParseTreeTest, OperatorFixity) {
|
||||
" var t: Type = Int*;\n"
|
||||
" t = t**;\n"
|
||||
" n = n * n;\n"
|
||||
" n = n * *p;\n"
|
||||
" n = n*n;\n"
|
||||
" G(Int*, n * n);\n"
|
||||
"}");
|
||||
@@ -577,6 +578,11 @@ TEST_F(ParseTreeTest, OperatorFixity) {
|
||||
MatchNameReference("n"), "=",
|
||||
MatchInfixOperator(MatchNameReference("n"), "*",
|
||||
MatchNameReference("n")))),
|
||||
MatchExpressionStatement(MatchInfixOperator(
|
||||
MatchNameReference("n"), "=",
|
||||
MatchInfixOperator(
|
||||
MatchNameReference("n"), "*",
|
||||
MatchPrefixOperator("*", MatchNameReference("p"))))),
|
||||
MatchExpressionStatement(MatchInfixOperator(
|
||||
MatchNameReference("n"), "=",
|
||||
MatchInfixOperator(MatchNameReference("n"), "*",
|
||||
|
||||
Reference in New Issue
Block a user