Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Nov 14, 2025

  • Use uint32_t
  • Remove some useless size_t casts
  • Make some structs private, as only ever used by the language scanner
  • Add explicit header includes and explanations

@Girgias Girgias marked this pull request as ready for review November 14, 2025 09:03
@Girgias Girgias requested a review from ndossche November 14, 2025 09:03
zend_arena *ast_arena;
} zend_lex_state;

typedef struct _zend_heredoc_label {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to make these private, as they can be accessed via the public struct via heredoc_label_stack. Similar issue for zend_nest_location.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will revert.

#define ZEND_SCANNER_H

#include "zend_globals.h"
#include "zend_arena.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still include zend_globals, so what exactly do we gain by adding all these headers explicitly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to remove it, but annoyingly zend_php_scanner_event is defined there. And I don't know if it's sensible to "flip" the header inclusion so that zend_globals includes zend_language_scanner.h or not...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I don't think that makes sense, I don't like to pull the scanner into everything

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I thought too, I'm happy to remove the extra header includes and just have a comment explaining why we include globals.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants