From 210179777fb9e35b1df44d8b3f4fee4f5354e919 Mon Sep 17 00:00:00 2001 From: Taddeus Kroes <taddeuskroes@gmail.com> Date: Mon, 21 Jul 2014 11:45:11 +0200 Subject: [PATCH] Renamed some tokens --- lexer.mll | 6 +++--- parser.mly | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lexer.mll b/lexer.mll index 7baece6..ddcb346 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 45f148a..e6b3d1d 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 -- GitLab