painfo

The painfo command prints every parameter, array and function that the script has defined.

Syntax

painfo

painfo takes no arguments.

What it does

James prints a note for each user-declared parameter, array element and function, in the order each was first declared, and then a note for every automatic parameter that has a value. The notes go to the diagnostic stream, with the location of the word painfo.

When James applies it

By the preprocessor, when it is read. The report shows the state at that line. It is legal in any phase: Control, Part or Merge.

Rules James adds

  • A user declaration is reported in the order it was first declared. Redeclaring a name in place does not move it.
  • An array reports one line per element, in Fortran order, as name(i,j) = value, or name(i,j) is not set.
  • A function reports as def followed by its declaration as written.
  • Every automatic parameter that holds a value is reported last, in a fixed order, with ` (automatic)` after it.

Diagnostics

  • None: James raises no diagnostic for painfo. Its lines are notes with no code.

Example

The script tests/corpus/008-hyphenated-name-not-subtraction/input.tg, which make test runs:

para a-1 5;
para result [%a-1];
painfo

James prints this, which tests/corpus/008-hyphenated-name-not-subtraction/expected.diag.txt holds:

input.tg:3:1: note: painfo: a-1 = 5
input.tg:3:1: note: painfo: result = 5
input.tg:3:1: note: painfo: pi = 3.141592653589793 (automatic)
input.tg:3:1: note: painfo: nextprt = 1 (automatic)
input.tg:3:1: note: painfo: nextsrf = 1 (automatic)
input.tg:3:1: note: painfo: nextln = 1 (automatic)
input.tg:3:1: note: painfo: nextld = 1 (automatic)
input.tg:3:1: note: painfo: nextcrv = 1 (automatic)

James prints the two parameters in the order they were declared, a-1 = 5 and result = 5, and then the six automatic parameters, pi and the five next... numbers.

See also

  • para: defines the parameters it reports.
  • array, def: the other things it reports.
  • Diagnostics: how James prints a note.

James 0.3.1.

This site uses Just the Docs, a documentation theme for Jekyll.