Files
personamanagmentlayer__pcl/tests/test-simple.mjs
ANGX 87f9aec4af feat(parser): enable persona body property parsing
- Fix parsePropertyDeclaration to accept contextual keywords as property names
- Allow KEYWORD, IDENTIFIER, PERSONA_ID tokens as property names
- Add Depth and Verbosity type definitions
- Fix default config values to match type definitions
- Move test files to proper tests/ folder

Resolves parsing failures:
- 'tone:', 'depth:', 'verbosity:' now parse as PropertyDeclarations
- Skills, constraints, tags blocks parse correctly
- Integration tests can now use full persona syntax

Status: Parser property improvements complete ✓
- Persona body properties: WORKING
- Skills/constraints/tags blocks: WORKING
- Next: Codegen and runtime integration
2026-01-16 07:25:15 +01:00

23 lines
607 B
JavaScript

import { parse } from '../dist/index.js';
console.log('Testing simple persona...\n');
const simpleSource = `persona SEC {
intent: "Security"
}`;
console.log('Source:', simpleSource);
console.log('\nParsing...');
const result = parse(simpleSource);
console.log('Result:', result.ok ? '✓ SUCCESS' : '✗ FAILED');
if (result.ok) {
console.log('Statements:', result.value.program.statements.length);
console.log('First statement:', result.value.program.statements[0].kind);
} else {
console.log('Errors:', result.error.length);
result.error.forEach(err => console.log(' -', err.message));
}