MCPcopy Create free account
hub / github.com/crossoverJie/gscript / Literal

Method Literal

parser/gscript_parser.go:3792–3863  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3790}
3791
3792func (p *GScriptParser) Literal() (localctx ILiteralContext) {
3793 localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState())
3794 p.EnterRule(localctx, 44, GScriptParserRULE_literal)
3795
3796 defer func() {
3797 p.ExitRule()
3798 }()
3799
3800 defer func() {
3801 if err := recover(); err != nil {
3802 if v, ok := err.(antlr.RecognitionException); ok {
3803 localctx.SetException(v)
3804 p.GetErrorHandler().ReportError(p, v)
3805 p.GetErrorHandler().Recover(p, v)
3806 } else {
3807 panic(err)
3808 }
3809 }
3810 }()
3811
3812 p.SetState(273)
3813 p.GetErrorHandler().Sync(p)
3814
3815 switch p.GetTokenStream().LA(1) {
3816 case GScriptParserDECIMAL_LITERAL:
3817 p.EnterOuterAlt(localctx, 1)
3818 {
3819 p.SetState(267)
3820 p.Match(GScriptParserDECIMAL_LITERAL)
3821 }
3822
3823 case GScriptParserFLOAT_LITERAL:
3824 p.EnterOuterAlt(localctx, 2)
3825 {
3826 p.SetState(268)
3827 p.Match(GScriptParserFLOAT_LITERAL)
3828 }
3829
3830 case GScriptParserSTRING_LITERAL, GScriptParserRAW_STRING_LIT:
3831 p.EnterOuterAlt(localctx, 3)
3832 {
3833 p.SetState(269)
3834 p.String_()
3835 }
3836
3837 case GScriptParserBOOL_LITERAL:
3838 p.EnterOuterAlt(localctx, 4)
3839 {
3840 p.SetState(270)
3841 p.Match(GScriptParserBOOL_LITERAL)
3842 }
3843
3844 case GScriptParserNULL_LITERAL:
3845 p.EnterOuterAlt(localctx, 5)
3846 {
3847 p.SetState(271)
3848 p.Match(GScriptParserNULL_LITERAL)
3849 }

Callers 3

PrimaryMethod · 0.95
VisitPrimaryMethod · 0.45
ExitPrimaryMethod · 0.45

Calls 4

String_Method · 0.95
NewLiteralContextFunction · 0.85
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected