Skip to content

Commit aa1307d

Browse files
authored
Merge pull request #42 from Irwin1985/version_9
Prevent the input source from invalid characters
2 parents ec825e4 + bb86cb2 commit aa1307d

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

jsonfox.app

68 Bytes
Binary file not shown.

src/tokenizer.prg

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
* <<DEBUG>>
2-
* =========================================
3-
*!* Clear
4-
*!* Cd f:\desarrollo\github\jsonfox\src\
5-
*!* sc = CreateObject("Tokenizer", '"string"')
6-
*!* tokens = sc.scanTokens()
7-
*!* For i = 1 to Alen(tokens)
8-
*!* ? sc.tokenStr(tokens[i])
9-
*!* Endfor
10-
* =========================================
11-
* <<DEBUG>>
12-
131
#include "JSONFox.h"
142
* Tokenizer
153
define class Tokenizer as custom
@@ -26,11 +14,16 @@ define class Tokenizer as custom
2614
Dimension tokens[1]
2715
sourceLen = 0
2816

29-
3017
function init(tcSource)
3118
With this
3219
.length = 1
3320
.capacity = 0
21+
&& IRODG 11/08/2023 Inicio
22+
* We remove possible invalid characters from the input source.
23+
tcSource = STRTRAN(tcSource, CHR(0))
24+
tcSource = STRTRAN(tcSource, CHR(10))
25+
tcSource = STRTRAN(tcSource, CHR(13))
26+
&& IRODG 11/08/2023 Fin
3427
.source = tcSource
3528
.start = 0
3629
.current = 1

0 commit comments

Comments
 (0)