diff --git a/lexer.mll b/lexer.mll index 7baece63e6e53e7867af304d5a69a0fa4501e9b8..ddcb346f4c435d4a058e5d4416e7704b1ece01f3 100644 --- a/lexer.mll +++ b/lexer.mll @@ -99,13 +99,13 @@ rule token = parse | '@' uagent K E Y F R A M E S { KEYFRAMES_SYM } | '@' S U P P O R T S { SUPPORTS_SYM } - | (w | comment)* w A N D w (w | comment)* { SUPPORTS_AND } - | (w | comment)* w O R w (w | comment)* { SUPPORTS_OR } + | (w | comment)* w A N D w (w | comment)* { WS_AND } + | (w | comment)* w O R w (w | comment)* { WS_OR } | O N L Y { ONLY } | N O T { NOT } | A N D { AND } - (*| O R { OR } removed in favor of SUPPORTS_OR *) + (*| O R { OR } removed in favor of WS_OR *) | F R O M { FROM } | T O { TO } diff --git a/parser.mly b/parser.mly index 45f148a209885dd516b9e0c9f41f308e02f23048..e6b3d1d60d83f7b845ea8488390c78740ca96b55 100644 --- a/parser.mly +++ b/parser.mly @@ -54,7 +54,7 @@ %token <string> COMBINATOR RELATION STRING IDENT HASH URI FUNCTION %token LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK SEMICOL COLON COMMA DOT PLUS %token MINUS SLASH STAR ONLY AND (*OR*) NOT FROM TO EOF -%token SUPPORTS_AND SUPPORTS_OR +%token WS_AND WS_OR (* Start symbol *) %type <Types.stylesheet> stylesheet @@ -68,7 +68,7 @@ %inline wslist(sep, x): S* l=separated_list(sep, terminated(x, S*)) { l } %inline wspreceded(prefix, x): p=preceded(ig2(prefix, S*), x) { p } -%inline all_and: AND | SUPPORTS_AND {} +%inline all_and: AND | WS_AND {} cd: CDO S* | CDC S* {} @@ -176,10 +176,10 @@ supports_negation: | NOT S+ c=supports_condition_in_parens { Not c } supports_conjunction: - | hd=supports_condition_in_parens tl=preceded(SUPPORTS_AND, supports_condition_in_parens)+ + | hd=supports_condition_in_parens tl=preceded(WS_AND, supports_condition_in_parens)+ { And (hd :: tl) } supports_disjunction: - | hd=supports_condition_in_parens tl=preceded(SUPPORTS_OR, supports_condition_in_parens)+ + | hd=supports_condition_in_parens tl=preceded(WS_OR, supports_condition_in_parens)+ { Or (hd :: tl) } supports_declaration_condition: | LPAREN S* decl=supports_declaration RPAREN