Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
[CLOSED] Question about the internal structure of FpJSON
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Fpcupdeluxe
by
cdbc
[
Today
at 11:26:16 pm]
UI app to work with SQLit...
by
cb_1964
[
Today
at 11:25:17 pm]
Source Editor Collapsed P...
by
Martin_fr
[
Today
at 11:18:30 pm]
val return code
by
Paolo
[
Today
at 10:58:32 pm]
Gtk3 becomes default widg...
by
PascalDragon
[
Today
at 09:59:25 pm]
TCollection wiki entry
by
Thaddy
[
Today
at 08:48:54 pm]
Seeking performance feedb...
by
Xenno
[
Today
at 04:31:34 pm]
Pls support Double Comman...
by
Alexx2000
[
Today
at 04:02:56 pm]
Ignoring Exceptions - Hit...
by
Martin_fr
[
Today
at 03:50:47 pm]
Lazarus 4.6 may erase you...
by
Benoni_Edin
[
Today
at 01:22:02 pm]
Greyed out controls?
by
LeP
[
Today
at 12:21:25 pm]
Creating binary
by
marcov
[
Today
at 11:25:17 am]
is there PDS reader/expor...
by
cdbc
[
Today
at 08:59:50 am]
Problems with creating a ...
by
Remy Lebeau
[
Today
at 06:28:22 am]
Hello. I'm new to this co...
by
onionmixer
[
Today
at 03:55:53 am]
Selecting from a list of ...
by
J-G
[July 09, 2026, 11:38:39 pm]
Help needed on how to do ...
by
paweld
[July 09, 2026, 10:06:31 pm]
A recreation of the class...
by
count
[July 09, 2026, 08:53:45 pm]
GTK3 is now the default w...
by
bonmario
[July 09, 2026, 07:48:59 pm]
using bass to play sounds
by
Thaddy
[July 09, 2026, 05:57:43 pm]
DDE
by
Thaddy
[July 09, 2026, 05:01:24 pm]
FPC Unleashed (async/awai...
by
Thaddy
[July 09, 2026, 04:38:17 pm]
String constants being di...
by
mihaisheng
[July 09, 2026, 12:25:38 pm]
[New Component] ExtTabCtr...
by
ovidio
[July 09, 2026, 09:12:56 am]
Best name for procedure
by
LemonParty
[July 08, 2026, 10:27:44 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [CLOSED] Question about the internal structure of FpJSON (Read 495 times)
ALLIGATOR
Sr. Member
Posts: 451
I use FPC [main] 💪🐯💪
[CLOSED] Question about the internal structure of FpJSON
«
on:
August 11, 2025, 07:33:12 pm »
I am trying to understand why
JSONScanner.pp
in
TJSONScanner
has an
FParts
array in which the start and length of the token are encoded each time, then decoding and token construction in the form of a string is performed.
Why is this intermediate encoding-decoding necessary? I tried to understand, figure it out, find an example, but I couldn't.
After several tests, I get the impression that this array is never filled with more than one token... then what is it for?
Also, after testing, I see that all strings were created (initially, I thought that this array somehow cleverly allowed strings not to be created if they were not needed, but according to the test results, all strings are created).
Thus, at the moment, this array only slows down the parser's work without providing any advantage — it is easier to build a string right away.
BUT, maybe I'm missing something, and someone can explain to me how it works in more detail?
https://gitlab.com/freepascal.org/fpc/source/-/blob/5101d2c4ac68ddbb1872eecb096be852597792c2/packages/fcl-json/src/jsonscanner.pp#L86
https://gitlab.com/freepascal.org/fpc/source/-/blob/5101d2c4ac68ddbb1872eecb096be852597792c2/packages/fcl-json/src/jsonscanner.pp#L366
https://gitlab.com/freepascal.org/fpc/source/-/blob/5101d2c4ac68ddbb1872eecb096be852597792c2/packages/fcl-json/src/jsonscanner.pp#L390
«
Last Edit: August 12, 2025, 08:55:39 am by ALLIGATOR
»
Logged
I may seem rude - please don't take it personally
ALLIGATOR
Sr. Member
Posts: 451
I use FPC [main] 💪🐯💪
Re: Question about the internal structure of FpJSON
«
Reply #1 on:
August 12, 2025, 08:55:06 am »
In the morning, with a fresh head and more detailed testing, I understood why it was necessary
Logged
I may seem rude - please don't take it personally
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[CLOSED] Question about the internal structure of FpJSON
TinyPortal
© 2005-2018