Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/pkg/river/printer/testdata/block_comments.in
4096 views
// block_comments.in expects that comments within blocks are formatted to
// remain within the block with the proper indentation.

//
// Unlabeled blocks
//

// Comment is on same line as empty block header.
block { // comment
}

// Comment is on same line as non-empty block header.
block { // comment
  attr = 5
}

// Comment is alone in block body.
block {
// comment
}

// Comment is before a statement.
block {
// comment
  attr = 5
}

// Comment is after a statement.
block {
  attr = 5
// comment
}

//
// Labeled blocks
//

// Comment is on same line as empty block header.
block "label" { // comment
}

// Comment is on same line as non-empty block header.
block "label" { // comment
  attr = 5
}

// Comment is alone in block body.
block "label" {
// comment
}

// Comment is before a statement.
block "label" {
// comment
  attr = 5
}

// Comment is after a statement.
block "label" {
  attr = 5
// comment
}