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

Apply the DSGP 1 specs #25

Merged
merged 9 commits into from Nov 23, 2021
Merged

Apply the DSGP 1 specs #25

merged 9 commits into from Nov 23, 2021

Conversation

DiddiLeija
Copy link
Owner

@DiddiLeija DiddiLeija commented Nov 22, 2021

Closes #24. Variables are now possible.

TODO:

Variables are now possible.
@DiddiLeija DiddiLeija added the diddiscript: DSGP A PR/issue related to a DSGP (DiddiScript Grammar Proposal). label Nov 22, 2021
@DiddiLeija DiddiLeija mentioned this pull request Nov 22, 2021
@DiddiLeija
Copy link
Owner Author

Enable variable indexing inside functions.

Ok. According to the section mentioned above, I want to use option 2:

  1. Using string indexing only. To do that kind of markup, this DSGP proposes func("I have ${x}") (like other languages' indexes)

@DiddiLeija
Copy link
Owner Author

I've tested the newest features with a DiddiScript console on this branch. I share you an example:

(venv) C:\Users\Diego Ramirez\diddiparser2>nox -s generate-console
nox > Running session generate-console
nox > Creating virtual environment (virtualenv) using python.exe in .nox\generate-console
nox > python -m pip install -e .
nox > Generating a DiddiScript console...
nox > diddiscript-console

Welcome to the interactive DiddiParser console.
Parser version: 1.0.0
============================================================

> load_module("simpleio");
>
> !# Feature 1: Variable definition
> var name = "stranger";
>
> !# Feature 2: Storing variables from function results
> store_input("Name: ");
Name: Diego
> store_last_value("name"); !# The name of the variable goes quoted
>
> !# Feature 3: Using variables under strings
> print_text("Hello, ${name}. I am DiddiScript.");
Hello, Diego. I am DiddiScript.
> 
> ^Z
nox > Session generate-console was successful.

(venv) C:\Users\Diego Ramirez\diddiparser2>

@DiddiLeija
Copy link
Owner Author

Ok. One remaining blocker here: update docs.

Update the DSGP status.

I will do this separately, for technical reasons.

Copy link
Owner Author

@DiddiLeija DiddiLeija left a comment

Choose a reason for hiding this comment

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

All done here!

@DiddiLeija DiddiLeija marked this pull request as ready for review November 23, 2021 01:10
@DiddiLeija DiddiLeija merged commit 95d5599 into main Nov 23, 2021
@DiddiLeija DiddiLeija deleted the apply-dsgp-1 branch November 23, 2021 01:10
@DiddiLeija DiddiLeija added diddiscript: DSGP application This won't create a DSGP, but discusses/applies an existing one and removed diddiscript: DSGP A PR/issue related to a DSGP (DiddiScript Grammar Proposal). labels Nov 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
diddiscript: DSGP application This won't create a DSGP, but discusses/applies an existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adoption of DSGP 1
1 participant