(parser)
| 3998 | this.targetExpr = targetExpr || null; |
| 3999 | } |
| 4000 | static parse(parser) { |
| 4001 | var scope = null; |
| 4002 | if (parser.matchToken("global")) { |
| 4003 | scope = "global"; |
| 4004 | } else if (parser.matchToken("element")) { |
| 4005 | scope = "element"; |
| 4006 | if (parser.matchOpToken("'")) { |
| 4007 | parser.requireToken("s"); |
| 4008 | } |
| 4009 | } else if (parser.matchToken("dom")) { |
| 4010 | scope = "inherited"; |
| 4011 | } else if (parser.matchToken("local")) { |
| 4012 | scope = "local"; |
| 4013 | } |
| 4014 | let eltPrefix = parser.matchOpToken(":"); |
| 4015 | let caretPrefix = !eltPrefix && parser.matchOpToken("^"); |
| 4016 | let identifier = parser.matchTokenType("IDENTIFIER"); |
| 4017 | if (identifier && identifier.value) { |
| 4018 | var name = identifier.value; |
| 4019 | if (eltPrefix) { |
| 4020 | name = ":" + name; |
| 4021 | } else if (caretPrefix) { |
| 4022 | name = "^" + name; |
| 4023 | } |
| 4024 | if (scope === null) { |
| 4025 | if (name.startsWith("$")) { |
| 4026 | scope = "global"; |
| 4027 | } else if (name.startsWith(":")) { |
| 4028 | scope = "element"; |
| 4029 | } else if (name.startsWith("^")) { |
| 4030 | scope = "inherited"; |
| 4031 | } else { |
| 4032 | scope = "local"; |
| 4033 | } |
| 4034 | } |
| 4035 | var targetExpr = null; |
| 4036 | if (scope === "inherited" && parser.matchToken("on")) { |
| 4037 | var follows = parser.pushFollows("to", "into", "before", "after", "then"); |
| 4038 | try { |
| 4039 | targetExpr = parser.requireElement("expression"); |
| 4040 | } finally { |
| 4041 | parser.popFollows(follows); |
| 4042 | } |
| 4043 | } |
| 4044 | return new _SymbolRef(identifier, scope, name, targetExpr); |
| 4045 | } |
| 4046 | } |
| 4047 | resolve(context) { |
| 4048 | return context.meta.runtime.resolveSymbol( |
| 4049 | this.name, |
nothing calls this directly
no test coverage detected