untitled notebook

node v4.8.4
version: 1.0.1
endpointsharetweet
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) {}'));
Loading…

no comments

    sign in to comment