Использование ast-check

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"; }'); console.log('Empty.for: ' + m.matches('empty.for')('for(;;) {}')); console.log('For.with.init: ' + m.matches('for.with.init')('for(var i = 1;;) {}')); console.log('Any.for: ' + m.matches('any.for')('for(var j = 5; j < 100; j++) { console.log(j); }'));

no comments

    sign in to comment