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

Add SyntaxQ and add a new "String Tests" Section #1248

Merged
merged 3 commits into from
Dec 29, 2024
Merged

Add SyntaxQ and add a new "String Tests" Section #1248

merged 3 commits into from
Dec 29, 2024

Conversation

rocky
Copy link
Member

@rocky rocky commented Dec 28, 2024

  • Add SyntaxQ[]
  • Create "String Tests" section in the "Testing Expressions" Guide section
  • Misc lint.
  • move another eval function to mathics.eval

SyntaxQ[] is used in the PacletManager.

messages = {"string": "String expected at position `1` in `2`."}

summary_text = (
"test whether a string is as yntactically-correct a Mathics3 expression"
Copy link

Choose a reason for hiding this comment

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

Typo: syntactically

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Should be fixed now.

BTW I don't know why this reminded me, but a long time ago I asked you in slack about packages that would be easy to get running. Your reply in slack history has been long removed. Do you remember what package or packages you mentioned?

Copy link

Choose a reason for hiding this comment

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

BTW I don't know why this reminded me, but a long time ago I asked you in slack about packages that would be easy to get running. Your reply in slack history has been long removed. Do you remember what package or packages you mentioned?

I only documented this one in the Wiki:

@rocky rocky force-pushed the add-SyntaxQ branch 2 times, most recently from b005dbc to e8aa393 Compare December 28, 2024 14:34
Copy link
Contributor

@mmatera mmatera left a comment

Choose a reason for hiding this comment

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

The only thing that I think is missing here is to include some tests for SyntaxQ

@rocky
Copy link
Member Author

rocky commented Dec 29, 2024

The only thing that I think is missing here is to include some tests for SyntaxQ

There is a doctest for True and False. If there are other kinds of tests you'd like to see, please suggest them.
We might add a note in the doc suggesting that this is how one can check the version level, since that's what it is used for in PacletManager.

Also, we probably have pretty extensive Syntax checks (or should add them elsewhere). Checking the scanner and parser here doesn't feel that right.

@mmatera
Copy link
Contributor

mmatera commented Dec 29, 2024

The only thing that I think is missing here is to include some tests for SyntaxQ

There is a doctest for True and False. If there are other kinds of tests you'd like to see, please suggest them. We might add a note in the doc suggesting that this is how one can check the version level, since that's what it is used for in PacletManager.

Also, we probably have pretty extensive Syntax checks (or should add them elsewhere). Checking the scanner and parser here doesn't feel that right.

OK, in that case, let's add them in another round. Merge this when you feel it is ready.

@rocky
Copy link
Member Author

rocky commented Dec 29, 2024

There will indeed be more improvements down the line. We don't have SyntaxQ with a form. We don't have SyntaxLength implemented either. That tech-note class should be removed and the functions in that moved corresponding guide sections.

However, this allows us the possibility of running PacletManager which was the motivation for doing this.

@rocky rocky merged commit 2aecdb3 into master Dec 29, 2024
14 checks passed
@rocky rocky deleted the add-SyntaxQ branch December 29, 2024 21:42
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