Skip to content

Add null keyword as alias for nil - #874

Merged
sebastienros merged 3 commits into
mainfrom
copilot/add-support-for-null-keyword
Nov 20, 2025
Merged

sebastienros merged 3 commits into
mainfrom
copilot/add-support-for-null-keyword

Conversation

Copilot AI commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Adds null as a keyword that behaves identically to nil, returning NilValue.Instance.

Changes

  • FluidParser.cs: Added NilKeyword static field and updated Primary parser to handle both nil and null keywords
  • ParserTests.cs: Added 15 test cases verifying null has identical semantics to nil

Example

{% if x == null %}x is null{% endif %}
{% if null == nil %}both keywords equivalent{% endif %}
{{ null }}  {# renders as empty string #}

The null keyword now works in all contexts where nil is valid: comparisons, conditionals, and output expressions.

Original prompt

Add support for the null keyword. It should behave the same way as nil by returning the NilFluidValue.Instance.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 20, 2025 16:17
Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>
Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>
@sebastienros
sebastienros marked this pull request as ready for review November 20, 2025 16:24
Copilot AI changed the title [WIP] Add support for the null keyword to return NilFluidValue.Instance Add null keyword as alias for nil Nov 20, 2025
Copilot AI requested a review from sebastienros November 20, 2025 16:25
@sebastienros
sebastienros enabled auto-merge (squash) November 20, 2025 16:26
@sebastienros
sebastienros merged commit bf473ef into main Nov 20, 2025
3 checks passed
@sebastienros
sebastienros deleted the copilot/add-support-for-null-keyword branch November 20, 2025 16:27
sebastienros added a commit that referenced this pull request Aug 20, 2026
* Initial plan

* Add support for null keyword to behave like nil

Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>

* Add comment explaining nil and null keyword support

Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ee9c8775-0354-41dd-8226-89a69c60241c
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.

2 participants