Use '@' to separate form@line references.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 21 Mar 2020 00:15:12 +0000 (20:15 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 21 Mar 2020 00:15:12 +0000 (20:15 -0400)
src/core/Line.ts
src/core/Trace.test.ts
src/core/Trace.ts

index 3a838a033551c7d14511f845567db2e35c9b8713..300192c0fd00709d906024ef8f86c63d6c23fe94 100644 (file)
@@ -58,7 +58,7 @@ export class ReferenceLine<F extends Form<any>,
   // the one the Line is in, erase |form|'s type with |as any| to
   // keep TypeScript happy.
   constructor(form: FormClass<F>, line: L, description?: string, fallback?: T) {
-    super(description || `Reference ${form.name}-${line}`);
+    super(description || `Reference ${form.name}@${line}`);
     this._form = form;
     this._line = line;
     this._fallback = fallback;
@@ -108,7 +108,7 @@ export class AccumulatorLine<F extends Form<any>,
   private _line: L;
 
   constructor(form: FormClass<F>, line: L, description?: string) {
-    super(description || `Accumulator ${form.name}-${line}`);
+    super(description || `Accumulator ${form.name}@${line}`);
     this._form = form;
     this._line = line;
   }
index 42689d8fae6dd5d24025f98047f169482a73518f..3f49fdec4a9e551e6d0fbfb0a01e3367ac9327bf 100644 (file)
@@ -46,21 +46,21 @@ describe('tracing', () => {
   test('input line', () => {
     f.getValue(tr, 'i1');
     const trace = getLastTraceList();
-    expect(trace).toStrictEqual([ [ 'TF-i1 (Input from name)', 'TF input: name' ] ]);
+    expect(trace).toStrictEqual([ [ 'TF@i1 (Input from name)', 'TF input: name' ] ]);
   });
 
   test('computed line via input', () => {
     f.getValue(tr, 'c1');
     const trace = getLastTraceList();
-    expect(trace).toStrictEqual([ [ 'TF-c1', 'TF input: name' ] ]);
+    expect(trace).toStrictEqual([ [ 'TF@c1', 'TF input: name' ] ]);
   });
 
   test('computed line via input line', () => {
     f.getValue(tr, 'c2');
     const trace = getLastTraceList();
     expect(trace).toStrictEqual([
-      [ 'TF-c2', 'TF-i2 (Input from value)' ],
-      [ 'TF-i2 (Input from value)', 'TF input: value' ]
+      [ 'TF@c2', 'TF@i2 (Input from value)' ],
+      [ 'TF@i2 (Input from value)', 'TF input: value' ]
     ]);
   });
 
@@ -68,9 +68,9 @@ describe('tracing', () => {
     f.getValue(tr, 'r2');
     const trace = getLastTraceList();
     expect(trace).toStrictEqual([
-      [ 'TF-r2 (Reference TestForm-c2)', 'TF-c2' ],
-      [ 'TF-c2', 'TF-i2 (Input from value)' ],
-      [ 'TF-i2 (Input from value)', 'TF input: value' ]
+      [ 'TF@r2 (Reference TestForm@c2)', 'TF@c2' ],
+      [ 'TF@c2', 'TF@i2 (Input from value)' ],
+      [ 'TF@i2 (Input from value)', 'TF input: value' ]
     ]);
   });
 });
index 512e2e74c93b113d0d7d90ba756ddeb965273d26..997aefc99773aa180915927086bf496c5a06ff7e 100644 (file)
@@ -63,5 +63,5 @@ function formatLine(line: Line<any>): string {
   const description = line.description ? ` (${line.description})` : '';
   if (line.form === undefined)
     return `${line.constructor.name}${description}`;
-  return `${line.form.name}-${line.id}${description}`;
+  return `${line.form.name}@${line.id}${description}`;
 }