Skip to content

Commit

Permalink
Change Unicode \u -> U+ (Fix #127)
Browse files Browse the repository at this point in the history
Also, remove dfn for “Unicode code point” and remove “dfn-for” for
interface IDL.
  • Loading branch information
garykac committed Dec 17, 2016
1 parent 286df64 commit 2cfeb1f
Show file tree
Hide file tree
Showing 6 changed files with 335 additions and 359 deletions.
8 changes: 5 additions & 3 deletions build.py
Expand Up @@ -115,6 +115,8 @@ def process_text(self, desc):
pre = self.process_text(m.group(1))
name = m.group(2)
post = self.process_text(m.group(3))
if name[0:2] != 'U+':
self.error('Invalid Unicode value (expected U+xxxx): %s\n' % name)
desc = pre + '<code class="unicode">' + name + '</code>' + post

return desc
Expand Down Expand Up @@ -201,17 +203,17 @@ def process(self, src, dst):
self.curr_dst = dst

if not os.path.isfile(src):
self.error('File "%s" doesn\'t exist' % src)
self.error('File "%s" doesn\'t exist\n' % src)

try:
infile = open(src, 'r')
except IOError as e:
self.error('Unable to open "%s" for reading: %s' % (src, e))
self.error('Unable to open "%s" for reading: %s\n' % (src, e))

try:
outfile = open(dst, 'w')
except IOError as e:
self.error('Unable to open "%s" for writing: %s' % (dst, e))
self.error('Unable to open "%s" for writing: %s\n' % (dst, e))

self.line = 0
for line in infile:
Expand Down

0 comments on commit 2cfeb1f

Please sign in to comment.