~adeuring/goyaml/1243827

« back to all changes in this revision

Viewing changes to resolve.go

  • Committer: Roger Peppe
  • Date: 2011-12-15 16:20:57 UTC
  • mfrom: (28.2.2 goyaml-rune-changes)
  • Revision ID: roger.peppe@canonical.com-20111215162057-d0bi1ieoqh7yo5zu
merge goyaml-rune-changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
 
107
107
        case '.':
108
108
                // Not in the map, so maybe a normal float.
109
 
                floatv, err := strconv.Atof64(in)
 
109
                floatv, err := strconv.ParseFloat(in, 64)
110
110
                if err == nil {
111
111
                        return "!!float", floatv
112
112
                }
113
 
                // XXX Handle base 60 floats here (WTF!)
 
113
        // XXX Handle base 60 floats here (WTF!)
114
114
 
115
115
        case 'D', 'S':
116
116
                // Int, float, or timestamp.
120
120
                                break
121
121
                        }
122
122
                }
123
 
                intv, err := strconv.Btoi64(in, 0)
 
123
                intv, err := strconv.ParseInt(in, 0, 64)
124
124
                if err == nil {
125
125
                        if intv == int64(int(intv)) {
126
126
                                return "!!int", int(intv)
128
128
                                return "!!int", intv
129
129
                        }
130
130
                }
131
 
                floatv, err := strconv.Atof64(in)
 
131
                floatv, err := strconv.ParseFloat(in, 64)
132
132
                if err == nil {
133
133
                        return "!!float", floatv
134
134
                }
135
135
                if strings.HasPrefix(in, "0b") {
136
 
                        intv, err := strconv.Btoi64(in[2:], 2)
 
136
                        intv, err := strconv.ParseInt(in[2:], 2, 64)
137
137
                        if err == nil {
138
138
                                return "!!int", int(intv)
139
139
                        }
140
140
                } else if strings.HasPrefix(in, "-0b") {
141
 
                        intv, err := strconv.Btoi64(in[3:], 2)
 
141
                        intv, err := strconv.ParseInt(in[3:], 2, 64)
142
142
                        if err == nil {
143
143
                                return "!!int", -int(intv)
144
144
                        }
145
145
                }
146
 
                // XXX Handle timestamps here.
 
146
        // XXX Handle timestamps here.
147
147
 
148
148
        case '<':
149
149
                // XXX Handle merge (<<) here.