Skip to content

Commit b399f82

Browse files
committed
Revision 0.11.1
1 parent 7f537c9 commit b399f82

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

src/token/internal/char.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ export const Digit = [Zero, ...NonZero] as TDigit
6767
// ------------------------------------------------------------------
6868
export const WhiteSpace = ' '
6969
export const NewLine = '\n'
70+
export const TabSpace = '\t'
7071
export const UnderScore = '_'
7172
export const Dot = '.'
7273
export const DollarSign = '$'
7374
export const Hyphen = '-'
7475

7576
export type TWhiteSpace = typeof WhiteSpace
7677
export type TNewLine = typeof NewLine
78+
export type TTabSpace = typeof TabSpace
7779
export type TUnderScore = typeof UnderScore
7880
export type TDot = typeof Dot
7981
export type TDollarSign = typeof DollarSign

src/token/internal/trim.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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> :

tasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Task.run('build', () => Task.build.dual('src', {
4848
packageJson: {
4949
name: '@sinclair/parsebox',
5050
description: 'Parser Combinators in the TypeScript Type System',
51-
version: '0.11.0',
51+
version: '0.11.1',
5252
keywords: ['typescript', 'parser', 'combinator'],
5353
license: 'MIT',
5454
author: 'sinclairzx81',
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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 '))

0 commit comments

Comments
 (0)