From 733bb34c4f70040ed25a1cefb9eb9f99b255a5d0 Mon Sep 17 00:00:00 2001 From: Simon Stranks Date: Sat, 4 Nov 2023 13:06:30 +0000 Subject: [PATCH] chore(): tidying up --- src/services/selectorPrinting.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/selectorPrinting.ts b/src/services/selectorPrinting.ts index 6a21def4..554a202a 100644 --- a/src/services/selectorPrinting.ts +++ b/src/services/selectorPrinting.ts @@ -487,13 +487,13 @@ export class SelectorPrinting { } // Edge case: 'n' without integer prefix A, with B integer non-existent, is not regarded as a binary expression token. - const scanner = new Scanner(); + const parser = new Parser(); const pseudoSelectorText = childElements[1].getText(); - scanner.setSource(pseudoSelectorText); - const firstToken = scanner.scan(); - const secondToken = scanner.scan(); + parser.scanner.setSource(pseudoSelectorText); + const firstToken = parser.scanner.scan(); + const secondToken = parser.scanner.scan(); + if (firstToken.text === 'n' || firstToken.text === '-n' && secondToken.text === 'of') { - const parser = new Parser(); const complexSelectorListNodes: nodes.Node[] = []; const complexSelectorText = pseudoSelectorText.slice(secondToken.offset + 2); const complexSelectorArray = complexSelectorText.split(',');