<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -129,18 +129,25 @@ var FluoTred = function () {
       expdiv.appendChild(buttons);
     }
 
-    var attPattern = /([^:]+)[:=]([^,]+),?/;
-    var headPattern = /^(\S*)( [.]*[^:=]*)?( .*)?$/;
+    var headPattern = /^(\S*)( [.]*[^:]*)?( .*)?$/;
+    var keyPattern = /([^ :]+|&quot;.*&quot;) *:/;
 
-    function parseAttributes (s) {
-      var h = {};
+    function quoteKeys (s) {
+      var ss = '';
       while (s) {
-        m = s.match(attPattern);
-        if ( ! m) break;
-        h[m[1].tqstrip()] = m[2].tqstrip();
-        s = s.substring(m[0].length);
+        var m = s.match(keyPattern);
+        if ( ! m) {
+          ss += s;
+          break;
+        }
+        ss += s.substring(0, m.index - 1);
+        var m1 = m[1].tstrip();
+        if (m1.match(/^&quot;.*&quot;$/)) ss += m1;
+        else ss += ('&quot;' + m1 + '&quot;');
+        ss += ':';
+        s = s.substring(m.index + m[0].length);
       }
-      return h;
+      return ss;
     }
 
     function renderAttributes (h) {
@@ -226,11 +233,15 @@ var FluoTred = function () {
         return d;
       },
 
+      parseAttributes: function (s) {
+        return fluoFromJson(&quot;{&quot; + quoteKeys(s) + &quot;}&quot;);
+      },
+
       parse: function (s) {
 
         var m = s.match(headPattern);
 
-        if (m == null) return ['---', {}, []];
+        if (m == null) return [ '---', {}, [] ];
 
         var expname = m[1];
 
@@ -241,7 +252,7 @@ var FluoTred = function () {
           if (t != '') children.push(t);
         }
 
-        atts = parseAttributes(m[3]);
+        atts = ExpressionHead.parseAttributes(m[3]);
 
         return [ expname, atts, children ];
       },
@@ -254,8 +265,7 @@ var FluoTred = function () {
         var text = node.childNodes[1].firstChild.nodeValue;
         var atts = node.childNodes[2].firstChild.nodeValue;
 
-        atts = fluoFromJson('({' + atts + '})');
-        // TODO : use parseAttributes !
+        atts = ExpressionHead.parseAttributes(atts);
 
         var children = [];
         if (text != '') children.push(text.tstrip()); </diff>
      <filename>public/js/fluo-tred.js</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
   name=&quot;TeaTesting&quot;
   revision=&quot;0.2&quot;
 &gt;
-  &lt;sequence&gt;
+  &lt;sequence on-error=&quot;quit&quot;&gt;
     &lt;participant ref=&quot;Reception&quot; /&gt;
     &lt;concurrence&gt;
       &lt;participant ref=&quot;Ted&quot; /&gt;</diff>
      <filename>public/pdef_ttt.xml</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@
 load('public/js/fluo-json.js');
 load('public/js/fluo-tred.js');
 
+/*
 function h_to_s (h) {
   var s = '{';
   for (var k in h) {
@@ -13,14 +14,22 @@ function h_to_s (h) {
 function exp_to_s (e) {
   return e[0] + ' ' + h_to_s(e[1]) + ' [' + e[2].toString() + ']';
 }
+*/
+
+win = 0;
+total = 0;
 
 function assert_rep (goal, source) {
 
+  total++;
+
   var result = FluoTred.ExpressionHead.parse(source);
-  result = exp_to_s(result);
+  //result = exp_to_s(result);
+  result = fluoToJson(result);
 
   if (result == goal) {
     print(&quot;\n .  '&quot; + source + &quot;'&quot;);
+    win++;
   }
   else {
     print(
@@ -29,20 +38,30 @@ function assert_rep (goal, source) {
   }
 }
 
-var empty = '--- {}';
-
-//print(exp_to_s([ 'nada', {surf:'really'}]));
-
-assert_rep(empty, '');
-assert_rep('alpha {} []', 'alpha')
-assert_rep('participant {} [alpha]', 'participant alpha')
-assert_rep('participant {} [alpha]', 'participant &quot;alpha&quot;')
-assert_rep('participant {} [al pha]', 'participant &quot;al pha&quot;')
-assert_rep('participant {activity:nada,} [al pha]', 'participant &quot;al pha&quot; activity: &quot;nada&quot;')
-assert_rep('participant {ref:alpha,} []', 'participant ref:alpha')
-assert_rep('participant {ref:alpha,} []', 'participant ref:&quot;alpha&quot;')
-assert_rep('participant {ref:alpha,} []', 'participant ref: &quot;alpha&quot;')
-assert_rep('participant {ref:alpha,} []', 'participant &quot;ref&quot;: &quot;alpha&quot;')
-assert_rep('participant {ref:alpha,} []', 'participant ref=&quot;alpha&quot;')
-assert_rep('participant {ref:alpha,} []', 'participant &quot;ref&quot;= &quot;alpha&quot;')
+//var empty = '--- {}';
+//assert_rep(empty, '');
+
+assert_rep('[&quot;alpha&quot;, {}, []]', 'alpha');
+assert_rep('[&quot;part&quot;, {}, [&quot;alpha&quot;]]', 'part alpha');
+assert_rep('[&quot;part&quot;, {}, [&quot;alpha&quot;]]', 'part &quot;alpha&quot;');
+assert_rep('[&quot;part&quot;, {}, [&quot;al pha&quot;]]', 'part &quot;al pha&quot;');
+assert_rep('[&quot;part&quot;, {&quot;act&quot;: &quot;nada&quot;}, [&quot;al pha&quot;]]', 'part &quot;al pha&quot; act: &quot;nada&quot;');
+//assert_rep('[&quot;part&quot;, {&quot;ref&quot;: &quot;alpha&quot;}, []]', 'part ref:alpha');
+assert_rep('[&quot;part&quot;, {&quot;ref&quot;: &quot;alpha&quot;}, []]', 'part ref:&quot;alpha&quot;');
+assert_rep('[&quot;part&quot;, {&quot;ref&quot;: &quot;alpha&quot;}, []]', 'part ref: &quot;alpha&quot;');
+assert_rep('[&quot;part&quot;, {&quot;ref&quot;: &quot;alpha&quot;}, []]', 'part &quot;ref&quot;: &quot;alpha&quot;');
+assert_rep('[&quot;part&quot;, {&quot;ref&quot;: &quot;alpha bravo&quot;}, []]', 'part ref: &quot;alpha bravo&quot;');
+//assert_rep('[&quot;part&quot;, {&quot;ref&quot;: &quot;alpha&quot;}, []]', 'part ref=&quot;alpha&quot;');
+//assert_rep('[&quot;part&quot;, {&quot;ref&quot;: &quot;alpha&quot;}, []]', 'part &quot;ref&quot;= &quot;alpha&quot;');
+
+assert_rep('[&quot;set&quot;, {&quot;value&quot;: 3.1}, []]', 'set value: 3.1');
+assert_rep('[&quot;set&quot;, {&quot;value&quot;: true}, []]', 'set value: true');
+assert_rep('[&quot;set&quot;, {&quot;value&quot;: [1, 2, 3]}, []]', 'set value:[1,2,3]');
+assert_rep('[&quot;set&quot;, {&quot;value&quot;: [1, [4], 2, 3]}, []]', 'set value:[1,[4],2,3]');
+assert_rep('[&quot;set&quot;, {&quot;value&quot;: [1, 2, 3]}, []]', 'set value:[ 1, 2, 3]');
+
+assert_rep('[&quot;set&quot;, {&quot;val&quot;: 1, &quot;var&quot;: [2]}, []]', 'set val:1, var:[2]');
+assert_rep('[&quot;set&quot;, {&quot;val&quot;: [1], &quot;var&quot;: [2]}, []]', 'set val:[1], var:[2]');
+
+print(&quot;\n... &quot; + win + &quot; / &quot; + total + &quot;\n&quot;);
 </diff>
      <filename>test/parse.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8627629992b4e6abaf67689cae2e23a19c006623</id>
    </parent>
  </parents>
  <author>
    <name>John Mettraux</name>
    <email>jmettraux@gmail.com</email>
  </author>
  <url>http://github.com/jmettraux/ruote-fluo/commit/6dbffce0e7402f86f9652211e5193fe83af5e718</url>
  <id>6dbffce0e7402f86f9652211e5193fe83af5e718</id>
  <committed-date>2009-04-10T02:52:54-07:00</committed-date>
  <authored-date>2009-04-09T18:37:53-07:00</authored-date>
  <message>accepting a compromise between json and js for input</message>
  <tree>00f7c25c5469e629cda0670cfd7106bd4659bdb7</tree>
  <committer>
    <name>John Mettraux</name>
    <email>jmettraux@gmail.com</email>
  </committer>
</commit>
