Menu

#292 Documentation Lacks Explanation: Comments don't handle at the beginning of a file in the indentaion mode

v1.0_(example)
open
1
2016-11-25
2016-11-25
No

Take the sample application 002.
Compile it with simple2.qx lexer.
Modify the sample source code example2.txt so the first line of code become a comment:

%% This is a comment
struct example:
..int x
..%% This is a comment
..double y

The token flow will contain invalid tokens at the beginning.

If I put an empty line into the source code before the comment it will work fine.

Discussion

  • Frank-Rene Schäfer

    • labels: --> Documentation, Indentation, off-side rule
    • summary: Comments don't handle at the beginning of a file in the indentaion mode --> Documentation Lacks Explanation: Comments don't handle at the beginning of a file in the indentaion mode
     
  • Frank-Rene Schäfer

    The 'indentation: comment' is only triggered after 'newline'.

    If you want '%' to start a comment, you also need to setup a '<skip_range: "%"="" "\\n"=""> ' for that.
    'skip_range' works beyond the indentation handling.

    This is a lack in the online documentation. The documentation is currently under rework.
    With your permission, I would like to file this against 'Documentation'.

     
  • Aleksey Kuhtenkov

    Thanks for the fast reply!

     

Log in to post a comment.