Rich2 / openstrat

Cross Platform Scala 2d graphics (but 3d compatible), basic geometry, maps, Earth maps, hex-tiling and strategy library(s).
https://richstrat.com
Apache License 2.0
22 stars 8 forks source link

RSON Comments. #82

Closed Rich2 closed 3 years ago

Rich2 commented 5 years ago

Check out.

Rich2 commented 4 years ago

So White space and some comments are to be attributed to the following Token if there is one.

/** This comment on
multiple lines will be attributed. */
/* This comment on
multiple lines will be discarded. */
//* This comment to the end of the line will be attributed.
// This comment to the end of the line will be discarded.

White space outside of comments will be attributed. White-space inside comments will be discarded, including newlines. This will allow comments to be used for line continuation. I think this will be better as the line continuation is indicated at the end of the old line and the beginning of the new line.

@w0d So currently the text position at the start of a file is 1, 1. I'm not entirely comfortable with this as an empty file or empty string has no line 1 and has no first character. Consider also

"\n"

Any thoughts?

Rich2 commented 3 years ago

I think this is working but it can be tested more thoroughly under #133, so I'm closing this into that issue.