/ play / index2.js
index2.js
 1  /* global global, console, URL, globalThis, process */
 2  
 3  import { streamParse, Context, AgastContext } from 'bablr/enhanceable';
 4  import { debugEnhancers } from '@bablr/helpers/enhancers';
 5  import { evaluateIO } from '@bablr/io-vm-node';
 6  import * as language from '@bablr/language-en-c-comments';
 7  import { generatePrettyCSTMLStrategy } from '@bablr/helpers/stream';
 8  
 9  import { buildFullyQualifiedSpamMatcher } from '@bablr/agast-vm-helpers';
10  
11  let enhancers = {};
12  
13  enhancers = { ...debugEnhancers, enhancers };
14  
15  const input = ` `;
16  
17  const matcher = buildFullyQualifiedSpamMatcher({}, language.canonicalURL, 'Trivia');
18  const ctx = Context.from(AgastContext.create(), language, enhancers.bablrProduction);
19  
20  const tokens = streamParse(ctx, matcher, input, {}, { enhancers, emitEffects: true });
21  
22  console.log();
23  
24  evaluateIO(() => generatePrettyCSTMLStrategy(tokens, { ctx, emitEffects: true }));