Skip to content

Conversation

@LeanSerra
Copy link
Owner

@LeanSerra LeanSerra commented Oct 28, 2025

Description

This PR adds AST generation for convDate and isZero

For convDate

  • convDate: is implemented by getting the date: DD-MM-YYYY we have to convert it to YYYYMMDD
    • If we treat each part of the date as an integer
      • YYYY * 1000 will give us: YYYY0000
      • MM * 100 will give us: MM00
      • DD * 1 will give us DD
  • Adding up all these values will give us YYYYMMDD

For isZero

  • isZero is implmented by after generating the AST for the expression inside isZero creating a leaf with a 0 value and creating a node with comparison "==" with the expression as the left_child and the 0 as the right_child

Copy link
Collaborator

@MatiBarcia MatiBarcia left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from feat/ast_io to main October 29, 2025 00:55
@LeanSerra LeanSerra marked this pull request as ready for review October 29, 2025 00:59
@LeanSerra LeanSerra merged commit 8b59a74 into main Oct 29, 2025
2 checks passed
@LeanSerra LeanSerra deleted the feat/compiler_builtins branch October 29, 2025 01:02
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.

3 participants