@@ -65,11 +65,12 @@ def parse():
6565if opts .profile :
6666import cProfile
6767import pstats
68- cProfile .runctx ("run(parseMethod, f, encoding)" ,None ,
68+ cProfile .runctx ("run(parseMethod, f, encoding, scripting )" ,None ,
6969 {"run" :run ,
7070"parseMethod" :parseMethod ,
7171"f" :f ,
72- "encoding" :encoding },
72+ "encoding" :encoding ,
73+ "scripting" :opts .scripting },
7374"stats.prof" )
7475# XXX - We should use a temp file here
7576stats = pstats .Stats ('stats.prof' )
@@ -79,7 +80,7 @@ def parse():
7980elif opts .time :
8081import time
8182t0 = time .time ()
82- document = run (parseMethod ,f ,encoding )
83+ document = run (parseMethod ,f ,encoding , opts . scripting )
8384t1 = time .time ()
8485if document :
8586printOutput (p ,document ,opts )
@@ -88,13 +89,13 @@ def parse():
8889else :
8990sys .stderr .write ("\n \n Run took: %fs" % (t1 - t0 ))
9091else :
91- document = run (parseMethod ,f ,encoding )
92+ document = run (parseMethod ,f ,encoding , opts . scripting )
9293if document :
9394printOutput (p ,document ,opts )
9495
95- def run (parseMethod ,f ,encoding ):
96+ def run (parseMethod ,f ,encoding , scripting ):
9697try :
97- document = parseMethod (f ,encoding = encoding )
98+ document = parseMethod (f ,encoding = encoding , scripting = scripting )
9899except :
99100document = None
100101traceback .print_exc ()
@@ -168,6 +169,9 @@ def getOptParser():
168169parser .add_option ("-f" ,"--fragment" ,action = "store_true" ,default = False ,
169170dest = "fragment" ,help = "Parse as a fragment" )
170171
172+ parser .add_option ("-s" ,"--scripting" ,action = "store_true" ,default = False ,
173+ dest = "scripting" ,help = "Handle noscript tags as if scripting was enabled" )
174+
171175parser .add_option ("" ,"--tree" ,action = "store_true" ,default = False ,
172176dest = "tree" ,help = "Output as debug tree" )
173177