diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-23 15:03:10 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-23 15:23:52 +0100 |
| commit | 4653ffebb43d733a3cff873d0903c7d00aaeb499 (patch) | |
| tree | 6a97b2e6a6903b3198547d6f3d0a7e3d2eb023cd /src/syntax | |
| parent | 84c6c8b0e6b17996a603ec88b7490107154f38f3 (diff) | |
Math module
Diffstat (limited to 'src/syntax')
| -rw-r--r-- | src/syntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/syntax/parser.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs index ceda2d57..4bab0c42 100644 --- a/src/syntax/ast.rs +++ b/src/syntax/ast.rs @@ -1505,7 +1505,7 @@ node! { impl SetRule { /// The function to set style properties for. - pub fn target(&self) -> Ident { + pub fn target(&self) -> Expr { self.0.cast_first_match().expect("set rule is missing target") } diff --git a/src/syntax/parser.rs b/src/syntax/parser.rs index 15839e18..07f53372 100644 --- a/src/syntax/parser.rs +++ b/src/syntax/parser.rs @@ -712,7 +712,14 @@ fn let_binding(p: &mut Parser) { fn set_rule(p: &mut Parser) { let m = p.marker(); p.assert(SyntaxKind::Set); + + let m2 = p.marker(); p.expect(SyntaxKind::Ident); + while p.eat_if(SyntaxKind::Dot) { + p.expect(SyntaxKind::Ident); + p.wrap(m2, SyntaxKind::FieldAccess); + } + args(p); if p.eat_if(SyntaxKind::If) { code_expr(p); |
