// Test to see the complete help output const ForthInterpreter = require('./forth.js'); console.log('🔍 Testing Complete Help Output\n'); let state = ForthInterpreter.createInitialState(); // Run help command console.log('Running help command...'); state = ForthInterpreter.parseAndExecute(state, 'help'); console.log('\n=== COMPLETE HELP OUTPUT ==='); state.output.forEach((line, i) => { console.log(`${i + 1}: ${line}`); }); console.log('\n=== ANALYSIS ==='); console.log('Total output lines:', state.output.length); // Count built-in words in help output const helpLines = state.output.filter(line => line.includes(' - ')); console.log('Lines with word documentation:', helpLines.length); // Check if specific words are present const expectedWords = ['dup', 'swap', 'drop', '+', '-', '*', '/', 'mod', 'if', 'then', 'begin', 'until']; expectedWords.forEach(word => { const found = helpLines.some(line => line.startsWith(word)); console.log(`${word}: ${found ? '✅' : '❌'}`); }); // Show first few documented words console.log('\nFirst 10 documented words:'); helpLines.slice(0, 10).forEach(line => console.log(line));