-
Notifications
You must be signed in to change notification settings - Fork 0
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
it should only generate grammar.js i think, but I'm not sure that makes sense anymore since it'd just use the default template to generate from. we could remove it and have the user create it instead, but it's nice to have a template created #5
Comments
Potential solutionThe user's issue suggests that there is uncertainty about whether to keep the automatic generation of Given the context, creating a dedicated function to generate How to implement
// src/generate-grammar.js
function generateGrammarTemplate() {
const defaultTemplate = `// Default grammar template content`;
// Logic to write the defaultTemplate to a grammar.js file
}
module.exports = { generateGrammarTemplate };
## Generating `grammar.js`
### Using the Generation Function
`grammar.js` can be generated using the `generateGrammarTemplate` function provided by the library.
#### How to Use the Generation Function
To generate `grammar.js`, follow these steps:
1. Import the `generateGrammarTemplate` function from the library.
2. Call the function to create the `grammar.js` file.
Example:
```javascript
const { generateGrammarTemplate } = require('path-to-generate-grammar');
generateGrammarTemplate();
By implementing these changes, the project will provide a clear and maintainable way to generate Click here to create a Pull Request with the proposed solution Files used for this task: Changes on tests/generate-grammar-tests.jsSince the Here's a practical proposal for when the time comes to implement tests:
For now, you can leave this file as is, and once the decision is made and implemented in Changes on README.mdSince the If the decision is to move the generation of
If the decision is to remove the automatic generation of
In either case, the Here is a template for the # Project Name
Brief description of the project and its purpose.
## Generating `grammar.js`
### Option 1: Using the Generation Function (if applicable)
Explain that `grammar.js` can be generated using a provided function.
#### How to Use the Generation Function
1. Step 1: Description of step 1.
2. Step 2: Description of step 2.
3. Step 3: Description of step 3.
#### Configuration Options (if applicable)
- Option 1: Description of option 1.
- Option 2: Description of option 2.
### Option 2: Manual Creation (if applicable)
Explain that users need to manually create `grammar.js` and provide the reasons for this change.
#### How to Manually Create `grammar.js`
1. Step 1: Description of step 1.
2. Step 2: Description of step 2.
3. Step 3: Description of step 3.
#### Default Template for `grammar.js`
```javascript
// Example default template code ContributingInstructions for how to contribute to the project. LicenseInformation about the project's license.
|
it should only generate grammar.js i think, but I'm not sure that makes sense anymore since it'd just use the default template to generate from. we could remove it and have the user create it instead, but it's nice to have a template created
or we could move generating just
grammar.js
into its own functionUrsprünglich gepostet von @amaanq in tree-sitter/tree-sitter#3123 (comment)
The text was updated successfully, but these errors were encountered: