This is shellscript, but it contains huge strings of cpp code

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–97 unchanged (97 lines)
98#include <netinet/in.h>
99#include <termios.h>
100#include <netinet/ip.h>
101#include <net/ip_mroute/ip_mroute.h>
102'
103
104includes_FreeBSD='
105#include <sys/capsicum.h>
106#include <sys/param.h>
107#include <sys/types.h>
108#include <sys/disk.h>
109#include <sys/event.h>
110#include <sys/sched.h>
111#include <sys/select.h>
112#include <sys/socket.h>
113#include <sys/sockio.h>
114#include <sys/stat.h>
115#include <sys/sysctl.h>
116#include <sys/mman.h>
…lines 117–132 unchanged (16 lines)
133#define SIOCAIFADDR _IOW(105, 26, struct oifaliasreq) // ifaliasreq contains if_data
134#undef SIOCSIFPHYADDR
135#define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq contains if_data
136#endif
137'
138
139includes_Linux='
140#define _LARGEFILE_SOURCE
141#define _LARGEFILE64_SOURCE
142#ifndef __LP64__
143#define _FILE_OFFSET_BITS 64
144#endif
145#define _GNU_SOURCE
…lines 146–184 unchanged (39 lines)
185#include <sys/stat.h>
186#include <sys/types.h>
187#include <sys/time.h>
188#include <sys/select.h>
189#include <sys/signalfd.h>
190#include <sys/socket.h>
191#include <sys/timerfd.h>
192#include <sys/uio.h>
193#include <sys/xattr.h>
194#include <linux/bpf.h>
195#include <linux/can.h>
196#include <linux/capability.h>
197#include <linux/cryptouser.h>
198#include <linux/devlink.h>
199#include <linux/errqueue.h>
200#include <linux/falloc.h>
201#include <linux/fanotify.h>
202#include <linux/filter.h>
203#include <linux/fs.h>
204#include <linux/fscrypt.h>
205#include <linux/fsverity.h>
206#include <linux/genetlink.h>
207#include <linux/hdreg.h>
208#include <linux/icmpv6.h>
209#include <linux/if.h>
210#include <linux/if_addr.h>
211#include <linux/if_alg.h>
212#include <linux/if_arp.h>
213#include <linux/if_ether.h>
214#include <linux/if_ppp.h>
215#include <linux/if_tun.h>
216#include <linux/if_packet.h>
217#include <linux/if_xdp.h>
218#include <linux/kexec.h>
219#include <linux/keyctl.h>
220#include <linux/loop.h>
221#include <linux/magic.h>
222#include <linux/memfd.h>
223#include <linux/module.h>
224#include <linux/netfilter/nfnetlink.h>
225#include <linux/netlink.h>
226#include <linux/net_namespace.h>
227#include <linux/nsfs.h>
228#include <linux/perf_event.h>
229#include <linux/ptrace.h>
230#include <linux/random.h>
231#include <linux/reboot.h>
232#include <linux/rtc.h>
233#include <linux/rtnetlink.h>
234#include <linux/sched.h>
235#include <linux/seccomp.h>
236#include <linux/serial.h>
237#include <linux/sockios.h>
238#include <linux/taskstats.h>
239#include <linux/tipc.h>
240#include <linux/vm_sockets.h>
241#include <linux/wait.h>
242#include <linux/watchdog.h>
243
244#include <mtd/ubi-user.h>
245#include <net/route.h>
246
247#if defined(__sparc__)
248// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the
249// definition in glibc. As only the error constants are needed here, include the
250// generic termibits.h (which is included by termbits.h on sparc).
251#include <asm-generic/termbits.h>
252#else
253#include <asm/termbits.h>
254#endif
255
256#ifndef MSG_FASTOPEN
257#define MSG_FASTOPEN 0x20000000
258#endif
259
260#ifndef PTRACE_GETREGS
261#define PTRACE_GETREGS 0xc
262#endif
263
264#ifndef PTRACE_SETREGS
265#define PTRACE_SETREGS 0xd
266#endif
267
268#ifndef SOL_NETLINK
269#define SOL_NETLINK 270
270#endif
271
272#ifdef SOL_BLUETOOTH
273// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
274// but it is already in bluetooth_linux.go
275#undef SOL_BLUETOOTH
276#endif
277
278// Certain constants are missing from the fs/crypto UAPI
279#define FS_KEY_DESC_PREFIX "fscrypt:"
280#define FS_KEY_DESC_PREFIX_SIZE 8
281#define FS_MAX_KEY_SIZE 64
282
283// The code generator produces -0x1 for (~0), but an unsigned value is necessary
284// for the tipc_subscr timeout __u32 field.
285#undef TIPC_WAIT_FOREVER
286#define TIPC_WAIT_FOREVER 0xffffffff
287
288// Copied from linux/l2tp.h
289// Including linux/l2tp.h here causes conflicts between linux/in.h
290// and netinet/in.h included via net/route.h above.
291#define IPPROTO_L2TP 115
292'
293
294includes_NetBSD='
295#include <sys/types.h>
296#include <sys/param.h>
297#include <sys/event.h>
298#include <sys/extattr.h>
299#include <sys/mman.h>
300#include <sys/mount.h>
301#include <sys/sched.h>
302#include <sys/select.h>
303#include <sys/socket.h>
304#include <sys/sockio.h>
305#include <sys/sysctl.h>
306#include <sys/termios.h>
307#include <sys/ttycom.h>
308#include <sys/wait.h>
…lines 309–323 unchanged (15 lines)
324#include <sys/types.h>
325#include <sys/param.h>
326#include <sys/event.h>
327#include <sys/mman.h>
328#include <sys/mount.h>
329#include <sys/select.h>
330#include <sys/sched.h>
331#include <sys/socket.h>
332#include <sys/sockio.h>
333#include <sys/stat.h>
334#include <sys/sysctl.h>
335#include <sys/termios.h>
336#include <sys/ttycom.h>
337#include <sys/unistd.h>
…lines 338–414 unchanged (77 lines)
415 echo
416 echo 'const ('
417
418 # The gcc command line prints all the #defines
419 # it encounters while processing the input
420 echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags |
421 awk '
422 $1 != "#define" || $2 ~ /\(/ || $3 == "" {next}
423
424 $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers
425 $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
426 $2 ~ /^(SCM_SRCRT)$/ {next}
427 $2 ~ /^(MAP_FAILED)$/ {next}
…lines 428–480 unchanged (53 lines)
481 $2 ~ /^HW_MACHINE$/ ||
482 $2 ~ /^SYSCTL_VERS/ ||
483 $2 !~ "MNT_BITS" &&
484 $2 ~ /^(MS|MNT|UMOUNT)_/ ||
485 $2 ~ /^NS_GET_/ ||
486 $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
487 $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT|TFD)_/ ||
488 $2 ~ /^KEXEC_/ ||
489 $2 ~ /^LINUX_REBOOT_CMD_/ ||
490 $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
491 $2 ~ /^MODULE_INIT_/ ||
492 $2 !~ "NLA_TYPE_MASK" &&
493 $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
494 $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
495 $2 ~ /^SIOC/ ||
496 $2 ~ /^TIOC/ ||
497 $2 ~ /^TCGET/ ||
498 $2 ~ /^TCSET/ ||
499 $2 ~ /^TC(FLSH|SBRKP?|XONC)$/ ||
500 $2 !~ "RTF_BITS" &&
501 $2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ ||
502 $2 ~ /^BIOC/ ||
503 $2 ~ /^DIOC/ ||
504 $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||
505 $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ ||
506 $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||
507 $2 ~ /^CLONE_[A-Z_]+/ ||
508 $2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ &&
509 $2 ~ /^(BPF|DLT)_/ ||
510 $2 ~ /^(CLOCK|TIMER)_/ ||
511 $2 ~ /^CAN_/ ||
512 $2 ~ /^CAP_/ ||
513 $2 ~ /^CP_/ ||
514 $2 ~ /^CPUSTATES$/ ||
515 $2 ~ /^ALG_/ ||
516 $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ ||
517 $2 ~ /^FS_IOC_.*(ENCRYPTION|VERITY|[GS]ETFLAGS)/ ||
518 $2 ~ /^FS_VERITY_/ ||
519 $2 ~ /^FSCRYPT_/ ||
520 $2 ~ /^GRND_/ ||
521 $2 ~ /^RND/ ||
522 $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
523 $2 ~ /^KEYCTL_/ ||
524 $2 ~ /^PERF_EVENT_IOC_/ ||
…lines 525–709 unchanged (185 lines)

After

…lines 1–97 unchanged (97 lines)
98#include <netinet/in.h>
99#include <termios.h>
100#include <netinet/ip.h>
101#include <net/ip_mroute/ip_mroute.h>
102'
103
104includes_FreeBSD='
105#include <sys/capsicum.h>
106#include <sys/param.h>
107#include <sys/types.h>
108#include <sys/event.h>
109#include <sys/select.h>
110#include <sys/socket.h>
111#include <sys/sockio.h>
112#include <sys/stat.h>
113#include <sys/sysctl.h>
114#include <sys/mman.h>
…lines 115–130 unchanged (16 lines)
131#define SIOCAIFADDR _IOW(105, 26, struct oifaliasreq) // ifaliasreq contains if_data
132#undef SIOCSIFPHYADDR
133#define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq contains if_data
134#endif
135'
136
137includes_Linux='
138#define _LARGEFILE_SOURCE
139#define _LARGEFILE64_SOURCE
140#ifndef __LP64__
141#define _FILE_OFFSET_BITS 64
142#endif
143#define _GNU_SOURCE
…lines 144–182 unchanged (39 lines)
183#include <sys/stat.h>
184#include <sys/types.h>
185#include <sys/time.h>
186#include <sys/select.h>
187#include <sys/signalfd.h>
188#include <sys/socket.h>
189#include <sys/uio.h>
190#include <sys/xattr.h>
191#include <linux/bpf.h>
192#include <linux/can.h>
193#include <linux/capability.h>
194#include <linux/cryptouser.h>
195#include <linux/devlink.h>
196#include <linux/errqueue.h>
197#include <linux/falloc.h>
198#include <linux/fanotify.h>
199#include <linux/filter.h>
200#include <linux/fs.h>
201#include <linux/fscrypt.h>
202#include <linux/genetlink.h>
203#include <linux/hdreg.h>
204#include <linux/icmpv6.h>
205#include <linux/if.h>
206#include <linux/if_addr.h>
207#include <linux/if_alg.h>
208#include <linux/if_arp.h>
209#include <linux/if_ether.h>
210#include <linux/if_ppp.h>
211#include <linux/if_tun.h>
212#include <linux/if_packet.h>
213#include <linux/if_xdp.h>
214#include <linux/kexec.h>
215#include <linux/keyctl.h>
216#include <linux/loop.h>
217#include <linux/magic.h>
218#include <linux/memfd.h>
219#include <linux/module.h>
220#include <linux/netfilter/nfnetlink.h>
221#include <linux/netlink.h>
222#include <linux/net_namespace.h>
223#include <linux/nsfs.h>
224#include <linux/perf_event.h>
225#include <linux/ptrace.h>
226#include <linux/random.h>
227#include <linux/reboot.h>
228#include <linux/rtc.h>
229#include <linux/rtnetlink.h>
230#include <linux/sched.h>
231#include <linux/seccomp.h>
232#include <linux/serial.h>
233#include <linux/sockios.h>
234#include <linux/taskstats.h>
235#include <linux/tipc.h>
236#include <linux/vm_sockets.h>
237#include <linux/wait.h>
238#include <linux/watchdog.h>
239
240#include <mtd/ubi-user.h>
241#include <net/route.h>
242
243#if defined(__sparc__)
244// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the
245// definition in glibc. As only the error constants are needed here, include the
246// generic termibits.h (which is included by termbits.h on sparc).
247#include <asm-generic/termbits.h>
248#else
249#include <asm/termbits.h>
250#endif
251
252#ifndef MSG_FASTOPEN
253#define MSG_FASTOPEN 0x20000000
254#endif
255
256#ifndef PTRACE_GETREGS
257#define PTRACE_GETREGS 0xc
258#endif
259
260#ifndef PTRACE_SETREGS
261#define PTRACE_SETREGS 0xd
262#endif
263
264#ifndef SOL_NETLINK
265#define SOL_NETLINK 270
266#endif
267
268#ifdef SOL_BLUETOOTH
269// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
270// but it is already in bluetooth_linux.go
271#undef SOL_BLUETOOTH
272#endif
273
274// Certain constants are missing from the fs/crypto UAPI
275#define FS_KEY_DESC_PREFIX "fscrypt:"
276#define FS_KEY_DESC_PREFIX_SIZE 8
277#define FS_MAX_KEY_SIZE 64
278
279// The code generator produces -0x1 for (~0), but an unsigned value is necessary
280// for the tipc_subscr timeout __u32 field.
281#undef TIPC_WAIT_FOREVER
282#define TIPC_WAIT_FOREVER 0xffffffff
283'
284
285includes_NetBSD='
286#include <sys/types.h>
287#include <sys/param.h>
288#include <sys/event.h>
289#include <sys/extattr.h>
290#include <sys/mman.h>
291#include <sys/mount.h>
…lines 292–306 unchanged (15 lines)
307#include <netinet/if_ether.h>
308
309// Needed since <sys/param.h> refers to it...
310#define schedppq 1
311'
312
313includes_OpenBSD='
314#include <sys/types.h>
315#include <sys/param.h>
316#include <sys/event.h>
317#include <sys/mman.h>
318#include <sys/mount.h>
319#include <sys/select.h>
…lines 320–403 unchanged (84 lines)
404 echo
405 echo 'const ('
406
407 # The gcc command line prints all the #defines
408 # it encounters while processing the input
409 echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags |
410 awk '
411 $1 != "#define" || $2 ~ /\(/ || $3 == "" {next}
412
413 $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers
414 $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
415 $2 ~ /^(SCM_SRCRT)$/ {next}
416 $2 ~ /^(MAP_FAILED)$/ {next}
…lines 417–469 unchanged (53 lines)
470 $2 ~ /^HW_MACHINE$/ ||
471 $2 ~ /^SYSCTL_VERS/ ||
472 $2 !~ "MNT_BITS" &&
473 $2 ~ /^(MS|MNT|UMOUNT)_/ ||
474 $2 ~ /^NS_GET_/ ||
475 $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
476 $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ ||
477 $2 ~ /^KEXEC_/ ||
478 $2 ~ /^LINUX_REBOOT_CMD_/ ||
479 $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
480 $2 ~ /^MODULE_INIT_/ ||
481 $2 !~ "NLA_TYPE_MASK" &&
482 $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
483 $2 ~ /^SIOC/ ||
484 $2 ~ /^TIOC/ ||
485 $2 ~ /^TCGET/ ||
486 $2 ~ /^TCSET/ ||
487 $2 ~ /^TC(FLSH|SBRKP?|XONC)$/ ||
488 $2 !~ "RTF_BITS" &&
489 $2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ ||
490 $2 ~ /^BIOC/ ||
491 $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||
492 $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ ||
493 $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||
494 $2 ~ /^CLONE_[A-Z_]+/ ||
495 $2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ &&
496 $2 ~ /^(BPF|DLT)_/ ||
497 $2 ~ /^(CLOCK|TIMER)_/ ||
498 $2 ~ /^CAN_/ ||
499 $2 ~ /^CAP_/ ||
500 $2 ~ /^ALG_/ ||
501 $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ ||
502 $2 ~ /^FS_IOC_.*ENCRYPTION/ ||
503 $2 ~ /^FSCRYPT_/ ||
504 $2 ~ /^GRND_/ ||
505 $2 ~ /^RND/ ||
506 $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
507 $2 ~ /^KEYCTL_/ ||
508 $2 ~ /^PERF_EVENT_IOC_/ ||
…lines 509–693 unchanged (185 lines)

Before

program
comment "#!/usr/bin/env bash"
comment "# Copyright 2009 The Go Authors. All rights reserved."
comment "# Use of this source code is governed by a BSD-style"
comment "# license that can be found in the LICENSE file."
comment "# Generate Go code listing errors and other #defined constan"...
comment "# values (ENAMETOOLONG etc.), by asking the preprocessor"
comment "# about the definitions."
unset_command
unset "unset"
variable_name "LANG"
declaration_command
export "export"
variable_assignment
variable_name "LC_ALL"
= "="
word "C"
declaration_command
export "export"
variable_assignment
variable_name "LC_CTYPE"
= "="
word "C"
if_statement (+39 nodes collapsed)
comment "# Check that we are using the new build system if we should"
if_statement (+65 nodes collapsed)
if_statement (+40 nodes collapsed)
if_statement (+31 nodes collapsed)
variable_assignment
variable_name "uname"
= "="
command_substitution
$( "$("
command
command_name
word "uname"
) ")"
variable_assignment
variable_name "includes_AIX"
= "="
raw_string "'\n#include <net/if.h>\n#include <net/netopt.h>\n#include <neti"...
variable_assignment
variable_name "includes_Darwin"
= "="
raw_string "'\n#define _DARWIN_C_SOURCE\n#define KERNEL\n#define _DARWIN_US"...
variable_assignment
variable_name "includes_DragonFly"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sy"...
variable_assignment
variable_name "includes_FreeBSD"
= "="
raw_string "'\n#include <sys/capsicum.h>\n#include <sys/param.h>\n#include "...
variable_assignment
variable_name "includes_Linux"
= "="
raw_string "'\n#define _LARGEFILE_SOURCE\n#define _LARGEFILE64_SOURCE\n#ifn"...
variable_assignment
variable_name "includes_NetBSD"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sy"...
variable_assignment
variable_name "includes_OpenBSD"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sy"...
variable_assignment
variable_name "includes_SunOS"
= "="
raw_string "'\n#include <limits.h>\n#include <sys/types.h>\n#include <sys/s"...
variable_assignment
variable_name "includes"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/file.h>\n#include <fcn"...
variable_assignment
variable_name "ccflags"
= "="
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
comment "# Write go tool cgo -godefs input."
redirected_statement
subshell
( "("
command
command_name
word "echo"
word "package"
word "unix"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'/*'"
variable_assignment
variable_name "indirect"
= "="
string
" "\""
string_content "includes_"
command_substitution
$( "$("
command
command_name
word "uname"
) ")"
" "\""
command
command_name
word "echo"
string
" "\""
expansion
${ "${"
! "!"
variable_name "indirect"
} "}"
simple_expansion
$ " $"
variable_name "includes"
" "\""
command
command_name
word "echo"
raw_string "'*/'"
command
command_name
word "echo"
raw_string "'import \"C\"'"
command
command_name
word "echo"
raw_string "'import \"syscall\"'"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'const ('"
comment "# The gcc command line prints all the #defines"
comment "# it encounters while processing the input"
pipeline
command
command_name
word "echo"
string
" "\""
expansion
${ "${"
! "!"
variable_name "indirect"
} "}"
simple_expansion
$ " $"
variable_name "includes"
" "\""
| "|"
command
command_name
simple_expansion
$ "$"
variable_name "CC"
word "-x"
word "c"
word "-"
word "-E"
word "-dM"
simple_expansion
$ "$"
variable_name "ccflags"
| "|"
command
command_name
word "awk"
raw_string "'\n\t\t$1 != \"#define\" || $2 ~ /\\(/ || $3 == \"\" {next}\n\n\t\t$2 ~ "...
| "|"
command
command_name
word "sort"
command
command_name
word "echo"
raw_string "')'"
) ")"
file_redirect
> ">"
word "_const.go"
comment "# Pull out the error names for later."
variable_assignment (+34 nodes collapsed)
comment "# Pull out the signal names for later."
variable_assignment (+40 nodes collapsed)
comment "# Again, writing regexps to a file."
redirected_statement (+32 nodes collapsed)
redirected_statement (+38 nodes collapsed)
command
command_name
word "echo"
raw_string "'// mkerrors.sh'"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
command
command_name
word "echo"
raw_string "'// Code generated by the command above; see README.md. DO N"...
command
command_name
word "echo"
command
command_name
word "echo"
string
" "\""
string_content "// +build "
expansion
${ "${"
variable_name "GOARCH"
} "}"
string_content ","
expansion
${ "${"
variable_name "GOOS"
} "}"
" "\""
command
command_name
word "echo"
redirected_statement
command
command_name
word "go"
word "tool"
word "cgo"
word "-godefs"
word "--"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
word "_const.go"
file_redirect
> ">"
word "_error.out"
pipeline
command
command_name
word "cat"
word "_error.out"
| "|"
command
command_name
word "grep"
word "-vf"
word "_error.grep"
| "|"
command
command_name
word "grep"
word "-vf"
word "_signal.grep"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'// Errors'"
command
command_name
word "echo"
raw_string "'const ('"
pipeline
command
command_name
word "cat"
word "_error.out"
| "|"
command
command_name
word "grep"
word "-f"
word "_error.grep"
| "|"
command
command_name
word "sed"
raw_string "'s/=\\(.*\\)/= syscall.Errno(\\1)/'"
command
command_name
word "echo"
raw_string "')'"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'// Signals'"
command
command_name
word "echo"
raw_string "'const ('"
pipeline
command
command_name
word "cat"
word "_error.out"
| "|"
command
command_name
word "grep"
word "-f"
word "_signal.grep"
| "|"
command
command_name
word "sed"
raw_string "'s/=\\(.*\\)/= syscall.Signal(\\1)/'"
command
command_name
word "echo"
raw_string "')'"
comment "# Run C program to print error and syscall strings."
redirected_statement (+93 nodes collapsed)
list (+31 nodes collapsed)

After

program
comment "#!/usr/bin/env bash"
comment "# Copyright 2009 The Go Authors. All rights reserved."
comment "# Use of this source code is governed by a BSD-style"
comment "# license that can be found in the LICENSE file."
comment "# Generate Go code listing errors and other #defined constan"...
comment "# values (ENAMETOOLONG etc.), by asking the preprocessor"
comment "# about the definitions."
unset_command
unset "unset"
variable_name "LANG"
declaration_command
export "export"
variable_assignment
variable_name "LC_ALL"
= "="
word "C"
declaration_command
export "export"
variable_assignment
variable_name "LC_CTYPE"
= "="
word "C"
if_statement (+39 nodes collapsed)
comment "# Check that we are using the new build system if we should"
if_statement (+65 nodes collapsed)
if_statement (+40 nodes collapsed)
if_statement (+31 nodes collapsed)
variable_assignment
variable_name "uname"
= "="
command_substitution
$( "$("
command
command_name
word "uname"
) ")"
variable_assignment
variable_name "includes_AIX"
= "="
raw_string "'\n#include <net/if.h>\n#include <net/netopt.h>\n#include <neti"...
variable_assignment
variable_name "includes_Darwin"
= "="
raw_string "'\n#define _DARWIN_C_SOURCE\n#define KERNEL\n#define _DARWIN_US"...
variable_assignment
variable_name "includes_DragonFly"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sy"...
variable_assignment
variable_name "includes_FreeBSD"
= "="
raw_string "'\n#include <sys/capsicum.h>\n#include <sys/param.h>\n#include "...
variable_assignment
variable_name "includes_Linux"
= "="
raw_string "'\n#define _LARGEFILE_SOURCE\n#define _LARGEFILE64_SOURCE\n#ifn"...
variable_assignment
variable_name "includes_NetBSD"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sy"...
variable_assignment
variable_name "includes_OpenBSD"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sy"...
variable_assignment
variable_name "includes_SunOS"
= "="
raw_string "'\n#include <limits.h>\n#include <sys/types.h>\n#include <sys/s"...
variable_assignment
variable_name "includes"
= "="
raw_string "'\n#include <sys/types.h>\n#include <sys/file.h>\n#include <fcn"...
variable_assignment
variable_name "ccflags"
= "="
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
comment "# Write go tool cgo -godefs input."
redirected_statement
subshell
( "("
command
command_name
word "echo"
word "package"
word "unix"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'/*'"
variable_assignment
variable_name "indirect"
= "="
string
" "\""
string_content "includes_"
command_substitution
$( "$("
command
command_name
word "uname"
) ")"
" "\""
command
command_name
word "echo"
string
" "\""
expansion
${ "${"
! "!"
variable_name "indirect"
} "}"
simple_expansion
$ " $"
variable_name "includes"
" "\""
command
command_name
word "echo"
raw_string "'*/'"
command
command_name
word "echo"
raw_string "'import \"C\"'"
command
command_name
word "echo"
raw_string "'import \"syscall\"'"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'const ('"
comment "# The gcc command line prints all the #defines"
comment "# it encounters while processing the input"
pipeline
command
command_name
word "echo"
string
" "\""
expansion
${ "${"
! "!"
variable_name "indirect"
} "}"
simple_expansion
$ " $"
variable_name "includes"
" "\""
| "|"
command
command_name
simple_expansion
$ "$"
variable_name "CC"
word "-x"
word "c"
word "-"
word "-E"
word "-dM"
simple_expansion
$ "$"
variable_name "ccflags"
| "|"
command
command_name
word "awk"
raw_string "'\n\t\t$1 != \"#define\" || $2 ~ /\\(/ || $3 == \"\" {next}\n\n\t\t$2 ~ "...
| "|"
command
command_name
word "sort"
command
command_name
word "echo"
raw_string "')'"
) ")"
file_redirect
> ">"
word "_const.go"
comment "# Pull out the error names for later."
variable_assignment (+34 nodes collapsed)
comment "# Pull out the signal names for later."
variable_assignment (+40 nodes collapsed)
comment "# Again, writing regexps to a file."
redirected_statement (+32 nodes collapsed)
redirected_statement (+38 nodes collapsed)
command
command_name
word "echo"
raw_string "'// mkerrors.sh'"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
command
command_name
word "echo"
raw_string "'// Code generated by the command above; see README.md. DO N"...
command
command_name
word "echo"
command
command_name
word "echo"
string
" "\""
string_content "// +build "
expansion
${ "${"
variable_name "GOARCH"
} "}"
string_content ","
expansion
${ "${"
variable_name "GOOS"
} "}"
" "\""
command
command_name
word "echo"
redirected_statement
command
command_name
word "go"
word "tool"
word "cgo"
word "-godefs"
word "--"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
word "_const.go"
file_redirect
> ">"
word "_error.out"
pipeline
command
command_name
word "cat"
word "_error.out"
| "|"
command
command_name
word "grep"
word "-vf"
word "_error.grep"
| "|"
command
command_name
word "grep"
word "-vf"
word "_signal.grep"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'// Errors'"
command
command_name
word "echo"
raw_string "'const ('"
pipeline
command
command_name
word "cat"
word "_error.out"
| "|"
command
command_name
word "grep"
word "-f"
word "_error.grep"
| "|"
command
command_name
word "sed"
raw_string "'s/=\\(.*\\)/= syscall.Errno(\\1)/'"
command
command_name
word "echo"
raw_string "')'"
command
command_name
word "echo"
command
command_name
word "echo"
raw_string "'// Signals'"
command
command_name
word "echo"
raw_string "'const ('"
pipeline
command
command_name
word "cat"
word "_error.out"
| "|"
command
command_name
word "grep"
word "-f"
word "_signal.grep"
| "|"
command
command_name
word "sed"
raw_string "'s/=\\(.*\\)/= syscall.Signal(\\1)/'"
command
command_name
word "echo"
raw_string "')'"
comment "# Run C program to print error and syscall strings."
redirected_statement (+93 nodes collapsed)
list (+31 nodes collapsed)