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
LRS Editor: A New Tool fo...
by
Xenno
[
Today
at 12:35:53 pm]
Font Name properties
by
J-G
[
Today
at 12:27:41 pm]
Amigo programming languag...
by
paxscript
[
Today
at 12:20:43 pm]
[SOLVED] How to draw on c...
by
artem101
[
Today
at 12:19:48 pm]
Why does Free Pascal use ...
by
tetrastes
[
Today
at 12:10:14 pm]
TlsLib4Pascal
by
Xor-el
[
Today
at 12:05:50 pm]
Synedit wordwrap
by
Martin_fr
[
Today
at 11:53:26 am]
array values as reference
by
Thaddy
[
Today
at 10:10:10 am]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[
Today
at 10:06:41 am]
Proper name for free meth...
by
Thaddy
[
Today
at 08:28:56 am]
BS Controls – Silly Compo...
by
Xenno
[
Today
at 06:53:52 am]
Adding persistent fields ...
by
paweld
[
Today
at 06:11:57 am]
QGradientTrackPanel: A Fu...
by
Ed78z
[
Today
at 01:24:17 am]
Solved: Picture Framer (R...
by
Boleeman
[
Today
at 12:20:27 am]
Lazarus Vs Codetyphon
by
BSaidus
[August 16, 2026, 09:59:46 pm]
MR - DebuggerIntf for ter...
by
Martin_fr
[August 16, 2026, 08:21:29 pm]
Is it possible to communi...
by
Warfley
[August 16, 2026, 08:15:43 pm]
LRS Explorer
by
Xenno
[August 16, 2026, 07:27:54 pm]
[Solved] The use of EXIT ...
by
440bx
[August 16, 2026, 07:27:20 pm]
TEDit PasswordChar not wo...
by
Hansaplast
[August 16, 2026, 05:19:01 pm]
Which Linux version
by
cdbc
[August 15, 2026, 08:28:37 pm]
[Qt5/Qt6] JPSupport-Qt: J...
by
shortcut
[August 15, 2026, 08:19:29 pm]
FpDebug: Bugs and API gap...
by
Martin_fr
[August 15, 2026, 08:07:50 pm]
Unleashed Pascal (async/a...
by
chamfay
[August 15, 2026, 10:35:09 am]
TDWEdit
by
docno
[August 15, 2026, 10:12:10 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [CLOSED] Question about the internal structure of FpJSON (Read 497 times)
ALLIGATOR
Sr. Member
Posts: 469
FPC git[main] Lazarus git[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
ALLIGATOR
Sr. Member
Posts: 469
FPC git[main] Lazarus git[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
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[CLOSED] Question about the internal structure of FpJSON
TinyPortal
© 2005-2018