import gulp from 'gulp';
import {build} from './build';
import {test} from './test';
import {makeParser, fixParser} from './parse';

const allSrcGlob = [
  'src/**/*.js',
  '!src/static/antlr4/parsers/**/*.js',
  'test/**/*.js',
];
const allBuildGlob = [
  'build/src/*.js',
  'build/test/**/*.js',
];
const grammarGlob = [
  'src/static/antlr4/grammars/**/*.g4',
  'build/src/static/antlr4/Translator.js',
];
const dataGlob = [
  'src/static/data/**/*.*',
];

export const watch = done => {
  gulp.watch(allSrcGlob, build);
  gulp.watch(allBuildGlob, test);
  gulp.watch(grammarGlob, gulp.series(makeParser, fixParser));
  gulp.watch(dataGlob, test);
  done();
};

gulp.task('watch', watch);

import gulp from 'gulp';
import {build} from './build';
import {test} from './test';
import {makeParser, fixParser} from './parse';

const allSrcGlob = [
  'src/**/*.js',
  '!src/static/antlr4/parsers/**/*.js',
  'test/**/*.js',
];
const allBuildGlob = [
  'build/src/*.js',
  'build/test/**/*.js',
];
const grammarGlob = [
  'src/static/antlr4/grammars/**/*.g4',
  'build/src/static/antlr4/Translator.js',
];
const dataGlob = [
  'src/static/data/**/*.*',
  'src/static/antlr4/parsers/TestudocParser.js',
];

export const watch = done => {
  gulp.watch(allSrcGlob, build);
  gulp.watch(allBuildGlob, test);
  gulp.watch(grammarGlob, gulp.series(makeParser, fixParser));
  gulp.watch(dataGlob, test);
  done();
};

gulp.task('watch', watch);

Test again when TestudocParser is recreated
Test again when TestudocParser is recreated
