* Parse bind feature * @param {Parser} parser * @returns {BindFeature | undefined}
(parser)
| 22 | * @returns {BindFeature | undefined} |
| 23 | */ |
| 24 | static parse(parser) { |
| 25 | if (!parser.matchToken("bind")) return; |
| 26 | |
| 27 | var follows = parser.pushFollows("and", "with", "to"); |
| 28 | var left; |
| 29 | try { |
| 30 | left = parser.requireElement("expression"); |
| 31 | } finally { |
| 32 | parser.popFollows(follows); |
| 33 | } |
| 34 | |
| 35 | if (!parser.matchToken("and") && !parser.matchToken("with") && !parser.matchToken("to")) { |
| 36 | parser.raiseExpected('and', 'with', 'to'); |
| 37 | } |
| 38 | |
| 39 | var right = parser.requireElement("expression"); |
| 40 | |
| 41 | return new BindFeature(left, right); |
| 42 | } |
| 43 | |
| 44 | constructor(left, right) { |
| 45 | super(); |
nothing calls this directly
no test coverage detected