Skip to content

[js] annotation/metadatas parsing : improve, using masks ? #19

@GuillaumeDua

Description

@GuillaumeDua

TODO: refine such proposal

Current syntax, behavior

As is, the parser produce for the following input the code after :

  • input
            THIS IS REMOVED // @awesome-doc-code-sections::skip::line
    auto main() -> int {    
                            // @awesome-doc-code-sections::show::block::begin
    auto i = 42; // test
    return i;
                            // @awesome-doc-code-sections::show::block::end
    }                       
            THIS IS REMOVED TOO // @awesome-doc-code-sections::skip::line
    
  • output
    auto i = 42; // test
    return i;

Proposal

The syntax above is verbose and heavy, on purpose. However, this can be improve in multiple ways :

  • use some filter logic

    • D aliases delete
    • S aliases show (kept)
    • H aliases hidden (but kept)
  • use scopes annotation

  • use default filter

    • // adcs:filter:default=D : everything is deleted by default
    • default's default is 'show'
  • input

    // adcs:filter:default=H
    THIS IS REMOVED // @adcs:filter=D
    constexpr auto value = 42; // @adcs:filter=S
    auto main() -> int {    
    // @adcs:filter=S{
       auto i = value;
       return i;
    // @adcs:filter=}S
    }
    
  • Output (show)

    constexpr auto value = 42;
       auto i = value;
       return i;
  • output (execute)

    constexpr auto value = 42;
    auto main() -> int { 
       auto i = value;
       return i;
    }

Misc

  • Decouples includes_transformations ?
  • (optionaly) decouples metadata from the code ? (index+offset based descriptor)

Metadata

Metadata

Assignees

Projects

Status

Pending (requires evaluation)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions