Explorar el Código

Added literal brackets to attrib strings

Taddeüs Kroes hace 11 años
padre
commit
7c7dcabd74
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      parser.mly

+ 2 - 1
parser.mly

@@ -141,7 +141,8 @@ cls:
 
 attrib:
   | LBRACK S? left=IDENT S? right=pair(RELATION, rel_value)? RBRACK
-  { left ^ (match right with None -> "" | Some (rel, term) -> rel ^ term) }
+  { let right = match right with None -> "" | Some (op, term) -> op ^ term in
+    "[" ^ left ^ right ^ "]" }
 %inline rel_value:
   | S? id=IDENT S?  { id }
   | S? s=STRING S?  { s }