P prints the arguments to the generated output. It handles strings and int32s, plus handling indirections because they may be *string, etc. Any inputs of type AnnotatedAtoms may emit annotations in a .meta file in addition to outputting the atoms themselves (if g.annotateCode is true).
(str ...interface{})
| 982 | // annotations in a .meta file in addition to outputting the atoms themselves (if g.annotateCode |
| 983 | // is true). |
| 984 | func (g *Generator) P(str ...interface{}) { |
| 985 | if !g.writeOutput { |
| 986 | return |
| 987 | } |
| 988 | g.WriteString(g.indent) |
| 989 | for _, v := range str { |
| 990 | switch v := v.(type) { |
| 991 | case *AnnotatedAtoms: |
| 992 | for _, v := range v.atoms { |
| 993 | g.printAtom(v) |
| 994 | } |
| 995 | default: |
| 996 | g.printAtom(v) |
| 997 | } |
| 998 | } |
| 999 | g.WriteByte('\n') |
| 1000 | } |
| 1001 | |
| 1002 | // addInitf stores the given statement to be printed inside the file's init function. |
| 1003 | // The statement is given as a format specifier and arguments. |
no test coverage detected