MCPcopy Create free account
hub / github.com/Glyphack/enderpy / parse_attribute_ref

Method parse_attribute_ref

parser/src/parser/parser.rs:2405–2421  ·  view source on GitHub ↗
(
        &mut self,
        node: Node,
        value: Expression,
    )

Source from the content-addressed store, hash-verified

2403 }
2404
2405 fn parse_attribute_ref(
2406 &mut self,
2407 node: Node,
2408 value: Expression,
2409 ) -> Result<Expression, ParsingError> {
2410 let mut expr = Ok(value);
2411 while self.eat(Kind::Dot) {
2412 let attr_val = self.cur_token().to_string(self.source);
2413 self.expect(Kind::Identifier)?;
2414 expr = Ok(Expression::Attribute(Box::new(Attribute {
2415 node: self.finish_node(node),
2416 value: expr?,
2417 attr: attr_val,
2418 })));
2419 }
2420 expr
2421 }
2422
2423 fn parse_subscript(
2424 &mut self,

Callers 2

parse_targetMethod · 0.80
parse_primaryMethod · 0.80

Calls 6

AttributeClass · 0.85
eatMethod · 0.80
to_stringMethod · 0.80
cur_tokenMethod · 0.80
expectMethod · 0.80
finish_nodeMethod · 0.80

Tested by

no test coverage detected