MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / SuffixedExpression

Method SuffixedExpression

LuaParser/src/Parse/LuaParser.cpp:802–840  ·  view source on GitHub ↗

suffixedexp -> primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs }+ */

Source from the content-addressed store, hash-verified

800/* suffixedexp ->
801 primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs }+ */
802CompleteMarker LuaParser::SuffixedExpression() {
803 auto m = Mark();
804 auto cm = PrimaryExpression();
805 bool suffix = false;
806 for (;;) {
807 switch (Current()) {
808 case '.': {
809 FieldSel();
810 break;
811 }
812 case '[': {
813 YIndex();
814 break;
815 }
816 case ':': {
817 FieldSel();
818 FunctionCallArgs();
819 break;
820 }
821 case '(':
822 case TK_LONG_STRING:
823 case TK_STRING:
824 case '{': {
825 FunctionCallArgs();
826 break;
827 }
828 default:
829 goto endLoop;
830 }
831 suffix = true;
832 }
833endLoop:
834 if (suffix) {
835 return m.Complete(*this, LuaSyntaxNodeKind::SuffixedExpression);
836 } else {
837 m.Undo(*this);
838 return cm;
839 }
840}
841
842void LuaParser::FunctionCallArgs() {
843 auto m = Mark();

Callers

nothing calls this directly

Calls 2

CompleteMethod · 0.80
UndoMethod · 0.80

Tested by

no test coverage detected