@ordojs/core
Version:
Core compiler and runtime for OrdoJS framework
39 lines (31 loc) • 1.12 kB
text/typescript
/**
* @fileoverview Debug focused HTML parsing
*/
import { describe, expect, it } from 'vitest';
import { OrdoJSLexer } from './lexer.js';
import { OrdoJSParser } from './parser.js';
describe('Debug Focused', () => {
it('should debug checkClosingTag method', () => {
const source = `
component TestComponent {
markup {
<div>Hello World</div>
}
}
`;
const lexer = new OrdoJSLexer(source, 'test.ordo');
const tokens = lexer.tokenize();
const parser = new OrdoJSParser(tokens, { allowRecovery: true }, 'test.ordo');
// Manually advance to the HTML_TAG_OPEN token for </
while (tokens.peek().type !== 'HTML_TAG_OPEN' || tokens.peek().value !== '</') {
if (tokens.isAtEnd()) break;
tokens.advance();
}
console.log('Current token (should be </):', tokens.peek());
console.log('Next token (should be div):', tokens.tokens[tokens.current + 1]);
// Test checkClosingTag method
const result = (parser as any).checkClosingTag('div');
console.log('checkClosingTag result:', result);
expect(true).toBe(true);
});
});