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

Fix the block comments parsing #21

Merged
merged 2 commits into from Jun 4, 2021
Merged

Fix the block comments parsing #21

merged 2 commits into from Jun 4, 2021

Conversation

DiddiLeija
Copy link
Owner

With this change, the user could write code at the same line than the commentary block (just before it begins or at the same line it ends).

I'll explain it with a simple example. I want the users to write code like this:

openfile("C:/Users/Administrador/Documents/hello.txt"); /* A comment starts here.
It must end here */ pyrun('print("Hello world")');

Before this fix, DiddiParser dropped both lines (and ignored the openfile() and the pyrun). Now, I want to fix that.

This means, the user could write code at the same line than the commentary block (just before it begins or at the same line it ends).
@DiddiLeija DiddiLeija added enhancement New feature or request bugfix Fix a bug. DiddiScript: Language Grammar An issue/PR with the general DiddiScript language (described in GRAMMAR.md) labels Jun 4, 2021
@DiddiLeija DiddiLeija added this to In Progress in DiddiParser project Jun 4, 2021
@DiddiLeija
Copy link
Owner Author

DiddiLeija commented Jun 4, 2021

But, I've been thinking about... maybe we are forgetting a case like this:

openfile('C:/Program Files/sample.py'); /* a block comment */
subprocess_run('pip check');

Here, as diddiparser.parser checks the block comments, it won't find where the block ends. So it will ignore the subprocess_run call. I will fix that.

Consider the comment on PR #21 , just before this commit.
@DiddiLeija
Copy link
Owner Author

NOTE: We are not saying that this is the recommended way to comment on DiddiScript. But if someone wants to do it, that's fine for me. Maybe later I could merge.

@DiddiLeija DiddiLeija merged commit b7dff57 into main Jun 4, 2021
@DiddiLeija DiddiLeija moved this from In Progress to Done in DiddiParser project Jun 4, 2021
@DiddiLeija DiddiLeija added this to the 1.1.1 release milestone Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix a bug. DiddiScript: Language Grammar An issue/PR with the general DiddiScript language (described in GRAMMAR.md) enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant