MCPcopy Create free account
hub / github.com/cel-expr/cel-go / FnDecl

Method FnDecl

repl/parser/commands_parser.go:1781–1887  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1779}
1780
1781func (p *CommandsParser) FnDecl() (localctx IFnDeclContext) {
1782 localctx = NewFnDeclContext(p, p.GetParserRuleContext(), p.GetState())
1783 p.EnterRule(localctx, 12, CommandsParserRULE_fnDecl)
1784 var _la int
1785
1786 p.EnterOuterAlt(localctx, 1)
1787 {
1788 p.SetState(111)
1789
1790 var _x = p.QualId()
1791
1792 localctx.(*FnDeclContext).id = _x
1793 }
1794 {
1795 p.SetState(112)
1796 p.Match(CommandsParserLPAREN)
1797 if p.HasError() {
1798 // Recognition error - abort rule
1799 goto errorExit
1800 }
1801 }
1802 p.SetState(121)
1803 p.GetErrorHandler().Sync(p)
1804 if p.HasError() {
1805 goto errorExit
1806 }
1807 _la = p.GetTokenStream().LA(1)
1808
1809 if _la == CommandsParserIDENTIFIER {
1810 {
1811 p.SetState(113)
1812
1813 var _x = p.Param()
1814
1815 localctx.(*FnDeclContext)._param = _x
1816 }
1817 localctx.(*FnDeclContext).params = append(localctx.(*FnDeclContext).params, localctx.(*FnDeclContext)._param)
1818 p.SetState(118)
1819 p.GetErrorHandler().Sync(p)
1820 if p.HasError() {
1821 goto errorExit
1822 }
1823 _la = p.GetTokenStream().LA(1)
1824
1825 for _la == CommandsParserCOMMA {
1826 {
1827 p.SetState(114)
1828 p.Match(CommandsParserCOMMA)
1829 if p.HasError() {
1830 // Recognition error - abort rule
1831 goto errorExit
1832 }
1833 }
1834 {
1835 p.SetState(115)
1836
1837 var _x = p.Param()
1838

Callers 3

LetMethod · 0.95
DeclareMethod · 0.95
Delete_Method · 0.95

Calls 11

QualIdMethod · 0.95
ParamMethod · 0.95
Type_Method · 0.95
NewFnDeclContextFunction · 0.85
LAMethod · 0.80
ReportErrorMethod · 0.80
RecoverMethod · 0.80
GetStateMethod · 0.65
MatchMethod · 0.65
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected