const matcher = require('ast-check').matcher;
const m = matcher();
m.
goal('empty.for').code('for(;;) {}').
goal('for.with.init').code('for(var i = 1;;) {}').
goal('any.for').code('for("#anything";"#anything";"#anything") { "#anything"; }').
goal('for.with.increment').
code('for(var i = 1; i < 10; "#for.update") {}').
fragment('for.update').
code(
'i++', '++i', 'i += 1', 'i = i + 1', 'i = 1 + i'
);
const forUpdate = m.matches('for.with.increment');
console.log('For.update.1: ' + forUpdate('for(var i = 1; i < 10; i = i + 1) {}'));
console.log('For.update.2: ' + forUpdate('for(var i = 1; i < 10; ++i) {}'));