Skip to content

Commit

Permalink
asdl_cpp: port the rest of changes from LFortran
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 4, 2022
1 parent ec8f418 commit 005b329
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grammar/asdl_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ def visitField(self, field, cons, last):
self.emit('s.append(std::to_string(x.m_%s));' % field.name, 2)
elif field.type == "float" and not field.seq and not field.opt:
self.emit('s.append("\\n" + indtd + "%s" + "%s=");' % (arr, field.name), 2)
self.emit('s.append(double_to_scientific(x.m_%s));' % field.name, 2)
self.emit('s.append(std::to_string(x.m_%s));' % field.name, 2)
elif field.type == "bool" and not field.seq and not field.opt:
self.emit('s.append("\\n" + indtd + "%s" + "%s=");' % (arr, field.name), 2)
self.emit("if (x.m_%s) {" % field.name, 2)
Expand Down Expand Up @@ -1391,7 +1391,7 @@ def visitField(self, field, cons):
else:
self.emit('s.append(std::to_string(x.m_%s));' % field.name, 2)
elif field.type == "float" and not field.seq and not field.opt:
self.emit('s.append(double_to_scientific(x.m_%s));' % field.name, 2)
self.emit('s.append(std::to_string(x.m_%s));' % field.name, 2)
elif field.type == "bool" and not field.seq and not field.opt:
self.emit("if (x.m_%s) {" % field.name, 2)
self.emit( 's.append(".true.");', 3)
Expand Down

0 comments on commit 005b329

Please sign in to comment.