Make Unicode some strings that should be, and improve error reporting in builtins.txt

Also work towards the convention that strings that represent text (possibly translatable) are in double quotes, not single.
This commit is contained in:
Sei Lisa 2016-12-20 19:22:48 +01:00
parent a124deb6b3
commit 39261cbfc8
5 changed files with 56 additions and 35 deletions

View file

@ -47,7 +47,7 @@ class outscript(object):
# is lost. So we emit a warning instead, letting the compiler
# report the error in the generated source.
if self.globalmode and self.listmode:
warning('Illegal combo: Key type inside a global list')
warning(u"Illegal combo: Key type inside a global list")
if self.listmode or not self.globalmode:
if self.globalmode:
pfx = '(key)'
@ -55,10 +55,10 @@ class outscript(object):
pfx = '((key)'
sfx = ')'
if '\t' in value and self.warntabs:
warning("A string contains a tab. Tabs are expanded to four"
" spaces by the viewer when copy-pasting the code"
" (disable this warning by disabling the 'warntabs'"
" option).")
warning(u"A string contains a tab. Tabs are expanded to four"
" spaces by the viewer when copy-pasting the code"
" (disable this warning by disabling the 'warntabs'"
" option).")
return pfx + '"' + value.encode('utf8').replace('\\','\\\\') \
.replace('"','\\"').replace('\n','\\n') + '"' + sfx
if tvalue == int: