Skip to content

Commit

Permalink
v.3.0.0 contd
Browse files Browse the repository at this point in the history
* fix a typo in python code (walking on lists/tuples used str keys while integer keys should be used)
* js umd fallback if loaded as es6 module
  • Loading branch information
Nikos M committed Mar 16, 2019
1 parent 12dc0cf commit 84acd83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/js/GrammarTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else if ( ('function'===typeof define)&&define.amd&&('function'===typeof require
define(name,['module'],function(module){factory.moduleUri = module.uri; return factory.call(root);});
else if ( !(name in root) ) /* Browser/WebWorker/.. */
(root[name] = factory.call(root)||1)&&('function'===typeof(define))&&define.amd&&define(function(){return root[name];} );
}( /* current root */ this,
}( /* current root */ 'undefined' !== typeof self ? self : this,
/* module name */ "GrammarTemplate",
/* module factory */ function ModuleFactory__GrammarTemplate( undef ){
"use strict";
Expand Down
2 changes: 1 addition & 1 deletion src/js/GrammarTemplate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/python/GrammarTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def walk( obj, keys, keys_alt=None, obj_alt=None ):
i += 1
if o is not None:
if isinstance(o,(list,tuple)) and int(k)<len(o):
o = o[k]
o = o[int(k)]
elif isinstance(o,dict) and (k in o):
o = o[k]
else:
Expand All @@ -83,7 +83,7 @@ def walk( obj, keys, keys_alt=None, obj_alt=None ):
i += 1
if o is not None:
if isinstance(o,(list,tuple)) and int(k)<len(o):
o = o[k]
o = o[int(k)]
elif isinstance(o,dict) and (k in o):
o = o[k]
else:
Expand All @@ -106,7 +106,7 @@ def walk( obj, keys, keys_alt=None, obj_alt=None ):
i += 1
if o is not None:
if isinstance(o,(list,tuple)) and int(k)<len(o):
o = o[k]
o = o[int(k)]
elif isinstance(o,dict) and (k in o):
o = o[k]
else:
Expand All @@ -128,7 +128,7 @@ def walk( obj, keys, keys_alt=None, obj_alt=None ):
i += 1
if o is not None:
if isinstance(o,(list,tuple)) and int(k)<len(o):
o = o[k]
o = o[int(k)]
elif isinstance(o,dict) and (k in o):
o = o[k]
else:
Expand Down

0 comments on commit 84acd83

Please sign in to comment.