Skip to content

Add nullptr literal with pointer coercion #17

Description

@grian32

Goal

Add a real null pointer literal so code can write null pointer values without (0 as T*), and so C/exdef null constants have a clean representation.

Tasks

  • Decide token spelling, likely nullptr.
  • Add lexer/parser/AST support.
  • Checker: allow coercion only into pointer contexts.
  • Emitter: lower to null pointer of target type.
  • Update exdef handling for ((void*)0) style constants.
  • Add syntax/docs examples.

Refs: TODO.md, cli/exdef.go:63.

Related: #4

Metadata

Metadata

Assignees

No one assigned

    Labels

    checkerChecker and semantic analysisenhancementNew feature or requestinteropC/foreign interoplanguageLanguage syntax or semantics

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions