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

Added basic support for ML-Lex and ML-Yacc files to CM file parser #60

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

csb6
Copy link
Contributor

@csb6 csb6 commented Jun 26, 2024

Description

The parser for CM files has been extended to handle ML-Lex and ML-Yacc specification files and add their generated files to the library sources.

Motivation

ML-Lex and ML-Yacc are SML/NJ's standard lexer and parser generators, respectively, and so have special integration with the CM build system. For source files with the extension ".l" or ".lex", CM automatically runs ML-Lex, which generates a file with the same filename as the ".lex" file with an additional ".sml" extension at the end. For files with ".y" or ".grm" extensions, CM runs ML-Yacc, generating both a ".sig" and ".sml" file in a similar way. All of the generated files are then treated as if they were explicitly listed in the .cm file and regenerated as needed.

Before this change, Millet showed an error ("unknown class") in CM files containing filenames with these extensions. Since the generated files were not being added to Millet's list of source files, completion and other analysis wasn't being done for these files. This limited my ability to use Millet with ML-Yacc and ML-Lex.

Tests

I have added tests to show that Millet can now parse CM files containing filenames with these extensions. I was not able to find existing tests that verify what actually ends up being added to Millet's sources list after parsing so I did not add any to verify that the generated files are added properly, but I may have missed them.

@azdavis azdavis self-requested a review June 27, 2024 05:56
Copy link
Owner

@azdavis azdavis left a comment

Choose a reason for hiding this comment

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

great!

@azdavis azdavis merged commit 31f4837 into azdavis:main Jun 27, 2024
3 checks passed
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