Permalink
Browse files

handle byte order mark

  • Loading branch information...
1 parent 32f2f91 commit 0e1f276504491dc48364e30a5888e198775d5785 @mmcgill committed Apr 16, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 asm.py
View
4 asm.py
@@ -7,6 +7,7 @@
import sys
import argparse
import os
+import codecs
def disjunction(*lst):
@@ -112,6 +113,9 @@ def report_error(filename, lineno, error):
labels = {}
for lineno, line in enumerate(open(args.input), start=1):
+ if lineno == 1:
+ line = line.lstrip(codecs.BOM_UTF8)
+
mo = line_regex.match(line)
if mo is None:
report_error(args.input, lineno, "Syntax error")

0 comments on commit 0e1f276

Please sign in to comment.