-
Notifications
You must be signed in to change notification settings - Fork 39
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
multiline comments #77
Comments
What happens with multiline comments inside multiline comments? E.g. Does it assemble or not? |
Can you please test this with directives inside the comment block?
|
@thrust26, they're not recursive. (neither are the same multiline style in C, java, ...) In your particular example, the entire line would be a comment. (see the the "doc" text above inserting comments prior to label or opcode.) If it stretched across multiple lines, the first */ encountered would be the terminator, the second an unknown opcode or label, depending on it's position. @andrew-davie, the functionality is part of the pre-interpreting cleanup, so it should work the same for everything. It just turns the block into a series of traditional single-line comments. Here's the list from your request... ------ FILE scratch.asm LEVEL 1 PASS 1 |
Perfect, thanks. |
Documentation updated ef0f21d |
A missing close-comment is not flagged by dasm. |
An isolated */ at the beginning of a line is interpreted as a label (!) |
I've updated master. Both cases will be flagged with a specific error now. |
TY. Tested and confirmed working on my use-cases. |
In the case where anything on a line after */ is ignored, this is a pretty non-obvious silent failure.
|
Rather than doing a quarter of the work and alert for all failures, I updated the code to handle multi-line comments exactly like C. They can now proceed labels and ops, or even be between an op and an op argument, multiple comments per line, whatever. They still get added to the end-line comment in the list file, but otherwise they're completely invisible to the parser now, wherever they are. Sorry to make you revise the doc, but the comments about restrictions can be removed there. Heads up that I also added a test case. I tried adding it for visibility here, but the software here mangled it, despite the code tag. |
Docs have be kindly updated by Andrew. Closing off this issue. |
This is an enhancement request for C style /* */ comments. I have the code, which I'll be pushing to master shortly.
Some suggested documentation comments follow...
Comments
Dasm has two different comment styles available, traditional assembler single-line ";" comments, and C-style "/* */" multiline comments.
Multiline comments make it easy to turn large blocks of code or text into comments. The "/" characters indicate the start of a comment block, and the "/" characters indicate the end of a block.
Valid multiline comment examples...
/* This single line comment is valid */
lda #1 /* And this comment is valid too */
/* And so is this
Multiline comment */
Inserting comments before a label or opcode isn't supported in dasm.
Invalid multiline comment examples...
/* the opcode to the right will be ignored */ lda #1
/* and so is the opcode
that follows this block
*/ lda #1
The text was updated successfully, but these errors were encountered: