Control of semicolon behaviour
See original GitHub issueMotivation
I’m using astring
as part of an atom plugin to help with code generation. It would be great to be able to control whether semicolons are emitted, so that I can match the current style directives of the current project. Right now, semicolons are implemented as a whole bunch of state.write(';')
instances.
It would be awesome to have a config option to control semicolon emission. I’m thinking that you could replace all those writes with a semantic state.terminate()
, which can check if it should print a semicolon or not.
The only alternative to control this is to basically fork the entire baseGenerator
, so you can remove all those writes.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Semicolons - Grammar and Mechanics - Academic Guides
The theory helps explain an individual's ability to exert self-control over his or her behavior. INCORRECT (The second clause here is dependent and...
Read more >Semicolon: The 2 Ways to Use a ; - The Write Practice
1. Use a semicolon to connect two independent clauses. You know what an independent clause is, right? A clause has a subject and...
Read more >How to Use a Semicolon - Herzing University
Let's look at the second reason to use a semicolon: separating items in a complicated list. ... Generally, you separate items in a...
Read more >Why is semicolon changing JavaScript behavior in the ...
The behaviour you experience comes from the special handling of inputs that begin with { and end with } in the Chrome devtools....
Read more >C Break and Continue Statements – Loop Control Statements ...
As with all statements in C, the break statement should terminate with a semicolon ( ; ). Let's take an example to understand...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This could be handled through a custom
output
stream, that removes semicolons:There are however two known issues to this:
Thus, a more precise handling is required. This could be a first step towards version 2. Pull requests are welcome.
@KFlash did you check my PR above ?