Skip to content

Commit

Permalink
all: don't use XXX strings unnecessarily
Browse files Browse the repository at this point in the history
None of these were "XXX" comments in the sense that the code
cannot be in master, as described in #1959.
Use more realistic examples, other characters like NNN,
or Foo... rather than FooXXX when we mean any object with that prefix.

For #1959.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Iece6ccbed29223ed44911f8fd1ecc622a6d443fc
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193723
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
  • Loading branch information
mvdan committed Apr 24, 2024
1 parent 53d5ab3 commit 506a0e8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ If you see something like...
remote: Processing changes: refs: 1, done
remote:
remote: ERROR: In commit ab13517fa29487dcf8b0d48916c51639426c5ee9
remote: ERROR: author email address XXXXXXXXXXXXXXXXXXX
remote: ERROR: author email address your.email@domain.com
remote: ERROR: does not match your user account.
```

Expand Down
2 changes: 1 addition & 1 deletion cue/ast/astutil/sanitize.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func (z *sanitizer) handleIdent(s *scope, n *ast.Ident) bool {
}

// uniqueName returns a new name globally unique name of the form
// base_XX ... base_XXXXXXXXXXXXXX or _base or the same pattern with a '_'
// base_NN ... base_NNNNNNNNNNNNNN or _base or the same pattern with a '_'
// prefix if hidden is true.
//
// It prefers short extensions over large ones, while ensuring the likelihood of
Expand Down
2 changes: 1 addition & 1 deletion cue/format/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func TestNodes(t *testing.T) {

}

// Verify that the printer doesn't crash if the AST contains BadXXX nodes.
// Verify that the printer doesn't crash if the AST contains Bad... nodes.
func TestBadNodes(t *testing.T) {
const src = "package p\n("
const res = "package p\n\n(_|_)\n"
Expand Down
4 changes: 2 additions & 2 deletions cue/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ type parser struct {
lit string // token literal

// Error recovery
// (used to limit the number of calls to syncXXX functions
// (used to limit the number of calls to sync... functions
// w/o making scanning progress - avoids potential endless
// loops across multiple parser functions during error recovery)
syncPos token.Pos // last synchronization position
syncCnt int // number of calls to syncXXX without progress
syncCnt int // number of calls to sync... functions without progress

// Non-syntactic parser control
exprLev int // < 0: in control clause, >= 0: in expression
Expand Down
2 changes: 1 addition & 1 deletion internal/core/adt/states.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const (
// This is a signal condition that is reached when:
// - a node is set to a concrete scalar value
// - a node is set to an error
// - or if XXXstate is reached.
// - or if ...state is reached.
//
// TODO: rename to something better?
scalarKnown
Expand Down
2 changes: 1 addition & 1 deletion internal/core/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ func (e *exporter) makeFeature(s string) (f adt.Feature, ok bool) {

// uniqueFeature returns a name for an identifier that uniquely identifies
// the given expression. If the preferred name is already taken, a new globally
// unique name of the form base_X ... base_XXXXXXXXXXXXXX is generated.
// unique name of the form base_N ... base_NNNNNNNNNNNNNN is generated.
//
// It prefers short extensions over large ones, while ensuring the likelihood of
// fast termination is high. There are at least two digits to make it visually
Expand Down

0 comments on commit 506a0e8

Please sign in to comment.