File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
test/parsebox/token/internal Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,15 @@ export const Digit = [Zero, ...NonZero] as TDigit
6767// ------------------------------------------------------------------
6868export const WhiteSpace = ' '
6969export const NewLine = '\n'
70+ export const TabSpace = '\t'
7071export const UnderScore = '_'
7172export const Dot = '.'
7273export const DollarSign = '$'
7374export const Hyphen = '-'
7475
7576export type TWhiteSpace = typeof WhiteSpace
7677export type TNewLine = typeof NewLine
78+ export type TTabSpace = typeof TabSpace
7779export type TUnderScore = typeof UnderScore
7880export type TDot = typeof Dot
7981export type TDollarSign = typeof DollarSign
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export type TTrim<Input extends string> = (
106106 Input extends `${OpenComment } ${infer Rest extends string } ` ? TTrim < TDiscardMultiLineComment < Rest > > :
107107 Input extends `${LineComment } ${infer Rest extends string } ` ? TTrim < TDiscardLineComment < Rest > > :
108108 Input extends `${Char . TNewLine } ${infer Rest extends string } ` ? TTrim < Rest > :
109+ Input extends `${Char . TTabSpace } ${infer Rest extends string } ` ? TTrim < Rest > :
109110 Input extends `${W4 } ${infer Rest extends string } ` ? TTrim < Rest > :
110111 Input extends `${W3 } ${infer Rest extends string } ` ? TTrim < Rest > :
111112 Input extends `${W1 } ${infer Rest extends string } ` ? TTrim < Rest > :
Original file line number Diff line number Diff line change 1+ import { Trim } from '../../../../src/token/internal/trim.ts'
2+ import { Assert } from 'test'
3+
4+ const Test = Assert . Context ( 'Token.Internal.Trim' )
5+
6+ Test ( 'Should Trim 1' , ( ) => Assert . IsExact ( Trim ( ' 1' ) , '1' ) )
7+ Test ( 'Should Trim 2' , ( ) => Assert . IsExact ( Trim ( ' 1 ' ) , '1 ' ) )
8+ Test ( 'Should Trim 3' , ( ) => Assert . IsExact ( Trim ( '\n\n\n1 ' ) , '1 ' ) )
9+ Test ( 'Should Trim 4' , ( ) => Assert . IsExact ( Trim ( '\n\n\n1 ' ) , '1 ' ) )
10+ Test ( 'Should Trim 5' , ( ) => Assert . IsExact ( Trim ( '\t\t\t1' ) , '1' ) )
11+ Test ( 'Should Trim 6' , ( ) => Assert . IsExact ( Trim ( '\t\t\t1 ' ) , '1 ' ) )
12+ Test ( 'Should Trim 7' , ( ) => Assert . IsExact ( Trim ( '\n\t 1' ) , '1' ) )
13+ Test ( 'Should Trim 8' , ( ) => Assert . IsExact ( Trim ( '\n\t 1 ' ) , '1 ' ) )
You can’t perform that action at this time.
0 commit comments