fastn icon indicating copy to clipboard operation
fastn copied to clipboard

Comment parsing bug!

Open jammutkarsh opened this issue 2 years ago • 7 comments

Comment parser bug

The comment in a fastn project is ;;(double semi-colon) as mentioned in the documentation But the code is getting commented with ::(double colon) too and it's not mentioned in docs.

If it's part of the design, please add it to documentation too.

jammutkarsh avatar Jun 10 '23 10:06 jammutkarsh

I would love to contribute to this documentation issue(if it is one)!

jammutkarsh avatar Jun 10 '23 10:06 jammutkarsh

@JammUtkarsh, thanks for reporting this. You can take a look at the parsing logic also, just for educational purpose: https://github.com/fastn-stack/fastn/blob/main/ftd/src/p1/parser.rs, maybe you can spot the issue.

@Heulitig can you take a look at this.

amitu avatar Jun 10 '23 14:06 amitu

I would love to learn and contribute(Unless Rithik is going to fix this). (Part of the reason is the story Ganesh told us about your contribution to Django.)

Since, I am new to the whole Rust ecosystem, is there a contribution.md, I couldn’t find any on the website or repository.

Thanks

jammutkarsh avatar Jun 12 '23 08:06 jammutkarsh

@JammUtkarsh

;; Actual comment (Case 1)
:: False comment (Case 2)

Do you mean to say the second case also works as a comment? If not then let us know the scenario where :: based comments are getting accepted.

Heulitig avatar Jun 13 '23 05:06 Heulitig

Do you mean to say the second case also works as a comment?

Yes

jammutkarsh avatar Jun 13 '23 13:06 jammutkarsh

@JammUtkarsh

:: False comment (Case 2)

Second case comment would work at the beginning of the code before the first section since it is already a known issue https://github.com/fastn-stack/fastn/issues/963. If the second case comment works anywhere else in the code do let us know otherwise you can take a look at the above mentioned issue.

Heulitig avatar Jun 13 '23 13:06 Heulitig

If you remove ::(double colon) from https://github.com/JammUtkarsh/fastn-hands-on/blob/f749d2de57cab281bcc3341a20e8203cda64d3ea/FASTN.ftd#L22 and run fastn serve then the side bar loads, which this should not be the case I guess. I believe it's different from the issue you mentioned above.

Please correct me if I am wrong?

jammutkarsh avatar Jun 13 '23 14:06 jammutkarsh