Skip to content

Parser: implement pstring (Pascal string) type #43

@unclesp1d3r

Description

@unclesp1d3r

Summary

Implement the pstring type for Pascal-style length-prefixed strings.

Context

The pstring type reads a length byte followed by that many bytes of string data. Some binary formats use this encoding for embedded strings.

Current state: Not implemented.

Acceptance Criteria

  • TypeKind extended with PString variant
  • Parser recognizes pstring type specifier
  • Evaluator reads length prefix byte, then reads that many bytes as string
  • String comparison operators work with pstring values
  • Bounds checking for length prefix exceeding buffer size
  • Unit tests

Impact

LOW - Less commonly used than other string types, but needed for full format compatibility.

Files to Modify

  • src/parser/ast.rs - Extend TypeKind enum
  • src/parser/grammar.rs - Parse pstring specifier
  • src/evaluator/types.rs - Implement read_pstring()

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestevaluatorRule evaluation engine and logicparserMagic file parsing components and grammarpriority:lowNice to have, can defer
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions