X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=parser.js;h=da8a1d56d7f3e39e4d1dabfd7795c5f666170f46;hb=88b991cd303157f00986f6c8b5d1bb223ac09737;hp=41eff934592d31c99143611465a7e1f001ae4f63;hpb=b8af38fdc3c2f56ffbf4f0be715742152a3f37c8;p=erdiag.git diff --git a/parser.js b/parser.js index 41eff93..da8a1d5 100644 --- a/parser.js +++ b/parser.js @@ -89,12 +89,12 @@ class ErDiags // attributes: ArrayOf {name, [isKey], [type], [qualifiers]} parseAttributes(lines, start, end) { - let attributes = []; + let attributes = [ ]; for (let i=start; i { if (e2.name == e.name) return; - e2.attributes.forEach( attr => { + this.entities[e2.name].attributes.forEach( attr => { if (attr.isKey) { this.tables[e.name].push({ @@ -242,7 +242,7 @@ class ErDiags }); }); // Add relationship potential own attributes - a.attributes.forEach( attr => { + (a.attributes || [ ]).forEach( attr => { newTable.fields.push({ name: attr.name, isKey: false,