Skip to content

Add debug/watch helpers: PSVariantToString overload, StringToPSVariant, PSBaseTypeToStr#312

Open
TetzkatLipHoka wants to merge 1 commit into
remobjects:masterfrom
TetzkatLipHoka:feature/debug-helpers
Open

Add debug/watch helpers: PSVariantToString overload, StringToPSVariant, PSBaseTypeToStr#312
TetzkatLipHoka wants to merge 1 commit into
remobjects:masterfrom
TetzkatLipHoka:feature/debug-helpers

Conversation

@TetzkatLipHoka

Copy link
Copy Markdown

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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant