Skip to content

Commit

Permalink
Set default debug mode to 1. Always add line nums, regardless of debu…
Browse files Browse the repository at this point in the history
…g level. Related to issue #853
  • Loading branch information
PierreQuentel committed Jan 1, 2020
1 parent 52feb3e commit 9580a7e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
11 changes: 5 additions & 6 deletions www/src/brython.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ new Function("$locals_script",js)({})}})(__BRYTHON__)
__BRYTHON__.implementation=[3,8,6,'final',0]
__BRYTHON__.__MAGIC__="3.8.6"
__BRYTHON__.version_info=[3,8,0,'final',0]
__BRYTHON__.compiled_date="2019-12-30 22:24:19.377720"
__BRYTHON__.timestamp=1577741059377
__BRYTHON__.compiled_date="2020-01-01 17:46:19.327656"
__BRYTHON__.timestamp=1577897179327
__BRYTHON__.builtin_module_names=["_aio","_ajax","_base64","_binascii","_jsre","_locale","_multiprocessing","_posixsubprocess","_profile","_sre_utils","_string","_strptime","_svg","_warnings","_webcomponent","_webworker","_zlib_utils","array","builtins","dis","hashlib","long_int","marshal","math","math1","math_kozh","modulefinder","posix","random","unicodedata"]
;

Expand Down Expand Up @@ -4990,8 +4990,7 @@ var catch_node=$NodeJS('catch(err)')
catch_node.add($NodeJS('$B.leave_frame()'))
catch_node.add($NodeJS('throw err'))
root.add(catch_node)
if($B.profile > 0){$add_profile(root,null,module)}
if($B.debug > 0){$add_line_num(root,null,module)}
$add_line_num(root,null,module)
var t1=new Date().getTime()
if($B.debug > 2){if(module==locals_id){console.log('module '+module+' translated in '+
(t1-t0)+' ms')}}
Expand All @@ -5009,9 +5008,9 @@ path_hooks.push($B.$path_hooks[0])}
$B.meta_path=meta_path
$B.path_hooks=path_hooks}
var brython=$B.parser.brython=function(options){
if(options===undefined){options={'debug':0}}
if(options===undefined){options={'debug':1}}
if(typeof options=='number'){options={'debug':options}}
if(options.debug===undefined){options.debug=0}
if(options.debug===undefined){options.debug=1}
$B.debug=options.debug
_b_.__debug__=$B.debug > 0
$B.compile_time=0
Expand Down
13 changes: 6 additions & 7 deletions www/src/brython_dist.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion www/src/brython_stdlib.js

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions www/src/py2js.js
Original file line number Diff line number Diff line change
Expand Up @@ -9908,10 +9908,8 @@ $B.py2js = function(src, module, locals_id, parent_scope, line_num){

root.add(catch_node)

if($B.profile > 0){$add_profile(root, null, module)}
if($B.debug > 0){
$add_line_num(root, null, module)
}
// Add line numbers for debugging
$add_line_num(root, null, module)

var t1 = new Date().getTime()
if($B.debug > 2){
Expand Down Expand Up @@ -9971,12 +9969,12 @@ $B.set_import_paths = function(){

var brython = $B.parser.brython = function(options){
// By default, only set debug level
if(options === undefined){options = {'debug': 0}}
if(options === undefined){options = {'debug': 1}}

// If the argument provided to brython() is a number, it is the debug
// level
if(typeof options == 'number'){options = {'debug': options}}
if(options.debug === undefined){options.debug = 0}
if(options.debug === undefined){options.debug = 1}
$B.debug = options.debug
// set built-in variable __debug__
_b_.__debug__ = $B.debug > 0
Expand Down
4 changes: 2 additions & 2 deletions www/src/version_info.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__BRYTHON__.implementation = [3, 8, 6, 'final', 0]
__BRYTHON__.__MAGIC__ = "3.8.6"
__BRYTHON__.version_info = [3, 8, 0, 'final', 0]
__BRYTHON__.compiled_date = "2019-12-30 22:24:19.377720"
__BRYTHON__.timestamp = 1577741059377
__BRYTHON__.compiled_date = "2020-01-01 17:46:19.327656"
__BRYTHON__.timestamp = 1577897179327
__BRYTHON__.builtin_module_names = ["_aio",
"_ajax",
"_base64",
Expand Down

0 comments on commit 9580a7e

Please sign in to comment.