Parse trailing semicolons appropriately.

Should be allowed inside graphs;
should never be the only element.