Add debug/watch helpers: PSVariantToString overload, StringToPSVariant, PSBaseTypeToStr#312
Open
TetzkatLipHoka wants to merge 1 commit into
Open
Conversation
…t, PSBaseTypeToStr
Hosts that embed a script debugger (watch windows, tooltips, REPL-style
inspection) all end up writing the same code: turn an arbitrary script
value into readable text and parse an edited value back. This adds the
helpers used by the TetzkatLipHoka fork's debugger frame:
- PSVariantToString(IFC, AppendType, NoQuotes): renders every base type
including sets (element list), records (field list), static/dynamic
arrays (element list, capped with '..' after 50 chars), variants
(with their VarType), nested pointers and classes (via TStrings.Text
or a published Caption/Title/Text/Lines/Strings property).
AppendType prefixes the Delphi-style type name; NoQuotes returns
string values raw instead of quoted.
- StringToPSVariant: the reverse direction for editable watches -
parses text into ordinal/float/string/char/variant slots and into
class instances via the same published properties. btPChar slots are
deliberately not written: they hold raw pointers to memory the engine
does not own.
- PSBaseTypeToStr(TPSBaseType/PIFTypeRec): base type names, optionally
as Delphi names ('Integer' instead of 'S32'); the PIFTypeRec overload
renders composed types (record field lists, array element types,
class names).
- VarTypeToString: readable names for TVarType values.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hosts that embed a script debugger (watch windows, tooltips, REPL-style
inspection) all end up writing the same code: turn an arbitrary script
value into readable text and parse an edited value back. This adds the
helpers used by the TetzkatLipHoka fork's debugger frame:
PSVariantToString(IFC, AppendType, NoQuotes): renders every base type
including sets (element list), records (field list), static/dynamic
arrays (element list, capped with '..' after 50 chars), variants
(with their VarType), nested pointers and classes (via TStrings.Text
or a published Caption/Title/Text/Lines/Strings property).
AppendType prefixes the Delphi-style type name; NoQuotes returns
string values raw instead of quoted.
StringToPSVariant: the reverse direction for editable watches -
parses text into ordinal/float/string/char/variant slots and into
class instances via the same published properties. btPChar slots are
deliberately not written: they hold raw pointers to memory the engine
does not own.
PSBaseTypeToStr(TPSBaseType/PIFTypeRec): base type names, optionally
as Delphi names ('Integer' instead of 'S32'); the PIFTypeRec overload
renders composed types (record field lists, array element types,
class names).
VarTypeToString: readable names for TVarType values.
🤖 Generated with Claude Code