Branch: refs/heads/master
Revision: d3a8bd2
Author: mppf
Log Message:
Merge pull request #17672 from mppf/dotexpr
compiler/next add Dot expression
This PR adds Dot AST nodes and parses dot expressions.
This class represents a dot expression. A dot expression might be:
- a method call
- field access
- qualified access within a module or enum
For example, a.b
, this.type
, Module.myFunc
are dot expressions.
Consider myObject.myMethod()
, or x.f(a=3)
. These are method
calls that also involve Dot expressions. These are represented as
an FnCall containing a Dot expression. For example, for x.f(a=3)
,
it is represented as
FnCall(calledExpression=x.f, actuals=[3], names=[a]);
where the x.f
is a Dot expression.
To make parsing myExpression.bytes()
easier, adds a FnCall::build
.
overload accepting no actuals. Also, adjusts the parser to parse calls
like myExpression.bytes[]
since this should be syntactically allowed,.
even if it is poor style.
Reviewed by @dlongnecke-cray and @lydia-duncan - thanks!
Modified Files:
A compiler/next/include/chpl/uast/Dot.h
A compiler/next/lib/uast/Dot.cpp
M compiler/next/include/chpl/uast/FnCall.h
M compiler/next/lib/frontend/Parser/chapel.ypp
M compiler/next/lib/frontend/Parser/parser-dependencies.h
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/FnCall.cpp
M compiler/next/test/frontend/testParse.cpp
M doc/util/nitpick_ignore
Compare: https://github.com/chapel-lang/chapel/compare/ef67d827bdee...d3a8bd2bc030