You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deffilterId (self, qualifiedId): # Convention: only called at emission time
620
622
ifself.idFiltering:
@@ -818,8 +820,14 @@ def prevTemp (self, name):
818
820
delself.tempIndices [name]
819
821
820
822
defuseModule (self, name):
821
-
self.module.program.importStack [-1][1] =self.lineNr# Remember line nr of import statement for the error report
822
-
returnself.module.program.provide (name) # Must be done first because it can generate a healthy exception
823
+
self.module.program.importStack [-1][1] =self.lineNr# Remember line nr of import statement for the error report
824
+
825
+
# Filter to get hyphen in name if a suitable alias is defined
826
+
# Filtering has to be done early, since the hyphen has to be used in the filename when loading the module
827
+
# The filename for this is made by the Program class, that doesn't have pragma's available
828
+
# So name has to be passed "ready made"
829
+
830
+
returnself.module.program.provide (self.filterId (name) ifutils.commandArgs.alimodelsename) # Must be done first because it can generate a healthy exception
Copy file name to clipboardExpand all lines: transcrypt/modules/org/transcrypt/utils.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ def parse (self):
37
37
38
38
self.argParser.add_argument ('source', nargs='?', help=".py file containing source code of main module")
39
39
self.argParser.add_argument ('-a', '--anno', help="annotate target files that were compiled from Python with source file names and source line numbers", action='store_true')
40
+
self.argParser.add_argument ('-am', '--alimod', help="use aliasing for module paths", action='store_true')
40
41
self.argParser.add_argument ('-b', '--build', help="rebuild all target files from scratch", action='store_true')
self.argParser.add_argument ('-d', '--docat', help="enable __doc__ attributes. Apply sparsely, since it will make docstrings part of the generated code", action='store_true')
@@ -297,7 +298,7 @@ def __pragma__ (name, *args):
297
298
298
299
namesPattern=re.compile ('({.*})')
299
300
pathPattern=re.compile ('([\'|\"].*[\'|\"])')
300
-
wordPattern=re.compile (r'\w+')
301
+
wordPattern=re.compile (r'[\w+$]')
301
302
forlineinpassableLines:
302
303
words=wordPattern.findall (line)
303
304
@@ -320,7 +321,7 @@ def __pragma__ (name, *args):
320
321
321
322
# Substitute to become "{'p', 'q', 'r', 's'}" and use that set to extend the exported names list
0 commit comments