You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
re2c is in the midst of acquiring a really flexible method for adding new language support thanks to its amazing maintainers. (Thank you, Skvadrik!)
Currently, even though there may be many different types of commenting conventions used in different languages, input files for a given language seem to usually follow a C/C++-like comment convention for the place to stash the re2c directives. This may not really be the case (I haven't delved deeply into the code) and I might be mistaken, but presuming I'm not: it would be nice for the new language support configuration to allow for a native comment convention to be used. I note, for example, that some languages might actually use C-like comments as operators (say, Python's integer division operator, //).
Alternatively, perhaps The Right Thing is indeed to use a convention distinct from the language's native comments (after all, these are not comments but are in fact directives to re2c to generate code!), but in that case, maybe it would be better to use another, prettier convention less likely to cause accidents?
The text was updated successfully, but these errors were encountered:
pmetzger
changed the title
Support different kinds of comments for different languages
Support different "comment" conventions for different languages.
Apr 16, 2024
This may be a good idea. My main concern is correctness of the re2c parser wrt. different languages. E.g. it has to parse string literals and character literals (as they may contain comment start), but these literals have slightly different syntax in different languages. See also related #429 which has a wider scope.
re2c is in the midst of acquiring a really flexible method for adding new language support thanks to its amazing maintainers. (Thank you, Skvadrik!)
Currently, even though there may be many different types of commenting conventions used in different languages, input files for a given language seem to usually follow a C/C++-like comment convention for the place to stash the re2c directives. This may not really be the case (I haven't delved deeply into the code) and I might be mistaken, but presuming I'm not: it would be nice for the new language support configuration to allow for a native comment convention to be used. I note, for example, that some languages might actually use C-like comments as operators (say, Python's integer division operator,
//
).Alternatively, perhaps The Right Thing is indeed to use a convention distinct from the language's native comments (after all, these are not comments but are in fact directives to re2c to generate code!), but in that case, maybe it would be better to use another, prettier convention less likely to cause accidents?
The text was updated successfully, but these errors were encountered: