Skip to content

Commit 4f80572

Browse files
committed
chore: working
1 parent 01dbbb4 commit 4f80572

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/bbob-parser/src/lexer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function createLexer(buffer: string, options: LexerOptions = {}): LexerTo
136136
const isNextEQ = nextChar === EQ;
137137
const isWS = isWhiteSpace(char);
138138
// const isPrevWS = isWhiteSpace(prevChar);
139-
const isNextWS = nextChar && isWhiteSpace(nextChar);
139+
const isNextWS = !!nextChar && isWhiteSpace(nextChar);
140140

141141
if (stateSpecial && isSpecialChar(char)) {
142142
return true;
@@ -202,7 +202,6 @@ export function createLexer(buffer: string, options: LexerOptions = {}): LexerTo
202202
// detect case where we have '[My word [tag][/tag]' or we have '[My last line word'
203203
const substr = chars.substrUntilChar(closeTag);
204204

205-
206205
const hasInvalidChars = substr.length === 0 || substr.indexOf(openTag) >= 0;
207206
const isNextCharReserved = nextChar && isCharReserved(nextChar)
208207
const isLastChar = chars.isLast()
@@ -241,7 +240,10 @@ export function createLexer(buffer: string, options: LexerOptions = {}): LexerTo
241240
const silent = true;
242241
const tagStr = chars.grabWhile((char) => char !== closeTag, silent);
243242
const tagGrabber = createCharGrabber(tagStr, { onSkip });
243+
const eqParts = tagStr.split(EQ);
244+
const isStartSingle = !!eqParts.length && !eqParts[0].includes(SPACE) && eqParts[0][0] !== SLASH;
244245
const hasSpace = tagGrabber.includes(SPACE);
246+
debugger
245247

246248
tagMode = TAG_STATE_NAME;
247249

packages/bbob-parser/test/parse.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ describe('Parser', () => {
527527

528528
test('parse url tag with fakeUnique', () => {
529529
const ast = parse('[url=https://example.org/ fakeUnique=fakeUnique]T[/url]');
530+
const ast2 = parse('[url]T[/url]');
531+
const ast3 = parse('[url src=some]T[/url]');
530532

531533
expectOutput(ast, [
532534
{

0 commit comments

Comments
 (0)