Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First iteration of the features feature for the declarative parser #1346

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jmgomez
Copy link
Collaborator

@jmgomez jmgomez commented Feb 12, 2025

There are a few things left to implement. Like adding a special syntax to requires.

This PR handles the scenarios for root packages.
See the tdeclarativeparser tests over the features packages. Nimble file

# Dependencies

feature "feature1":
  requires "stew"
when defined(features.features.feature1):
  echo "feature1 is enabled"
  import stew/byteutils #we should be able to import stew here as is its part of the feature1

else:
  echo "feature1 is disabled"

There are a few things left to implement. Like adding a special syntax to requires.
This PR handles the scenarios for root packages.
See the `tdeclarativeparser` tests over the `features` packages.
Nimble file
```nim
# Dependencies

requires "nim >= 2.3.1"

feature "feature1":
  requires "stew"

```nim

when defined(features.features.feature1):
  echo "feature1 is enabled"
  import stew/byteutils #we should be able to import stew here as is its part of the feature1

else:
  echo "feature1 is disabled"
```
@jmgomez jmgomez self-assigned this Feb 12, 2025
@jmgomez jmgomez requested a review from Araq February 12, 2025 12:40
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.

1 participant