css_ast/functions/
keypress_function.rs1use super::prelude::*;
2
3#[node]
9#[derive(Parse, Peek, ToCursors, ToSpan, SemanticEq, Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[cfg_attr(feature = "serde", derive(serde::Serialize))]
11#[cfg_attr(feature = "visitable", derive(csskit_derives::Visitable), visit(self))]
12#[derive(csskit_derives::NodeWithMetadata)]
13pub struct KeypressFunction {
14 #[atom(CssAtomSet::Keypress)]
15 pub name: T![Function],
16 pub params: T![String],
17 #[semantic_eq(skip)]
18 pub close: T![')'],
19}
20
21#[cfg(test)]
22mod tests {
23 use super::*;
24 use crate::CssAtomSet;
25 use css_parse::assert_parse;
26
27 #[test]
28 fn test_writes() {
29 assert_parse!(CssAtomSet::ATOMS, KeypressFunction, "keypress('a')");
30 }
31}