~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/cmd/gc/mkopnames

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-04-20 17:36:48 UTC
  • Revision ID: james.westby@ubuntu.com-20110420173648-ifergoxyrm832trd
Tags: upstream-2011.03.07.1
Import upstream version 2011.03.07.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Copyright 2009 The Go Authors. All rights reserved.
 
3
# Use of this source code is governed by a BSD-style
 
4
# license that can be found in the LICENSE file.
 
5
 
 
6
# Disable colored grep if user has it set to --color=always.
 
7
# (Arguably user error.)
 
8
export GREP_OPTIONS=""
 
9
 
 
10
echo '// auto generated by mkopnames'
 
11
echo 'static char*'
 
12
echo 'opnames[] = '
 
13
echo '{'
 
14
sed -n '/OXXX/,/OEND/p' go.h |
 
15
        cpp |
 
16
        sed 's!//.*!!; /^#/d'  |
 
17
        tr ' ' '\n' |
 
18
        tr -d ' \t,' |
 
19
        grep . |
 
20
        sort |
 
21
        grep -v '^OEND$' |
 
22
        sed 's/O//; s/.*/       [O&] =  "&",/'
 
23
echo '};'
 
24