Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re exception: bogus escape: '\\2' (Javascript) #2

Closed
ChristopherRabotin opened this issue Aug 29, 2013 · 6 comments
Closed

Re exception: bogus escape: '\\2' (Javascript) #2

ChristopherRabotin opened this issue Aug 29, 2013 · 6 comments

Comments

@ChristopherRabotin
Copy link

Input file is called "main.js" (so nothing spectacular).

Here's the traceback (I tried to correct the output from Powershell):

PS C:\Users\xxx> ..\..\Python\2.7\python.exe .\Apps\code2flow-master\code2fl
ow .\Apps\code2flow-master\2graph\main.js
Mapping .\Apps\code2flow-master\2graph\main
Removing comments and strings...
Generating function nodes...
Traceback (most recent call last):
  File ".\Apps\code2flow-master\code2flow", line 151, in <module>
    groups,nodes,edges = mapper.map()
  File "C:\Users\xxx\Apps\code2flow-master\code2flowlib\engine.py", line 814, in map
    fileGroup = self.generateFileGroup(name=filename,source=source)
  File "C:\Users\xxx\Apps\code2flow-master\code2flowlib\languages\javascript.py", line 329, in generateFileGroup
    return Group(name=name,source=source,fullSource=source,isFunction=True)
  File "C:\Users\xxx\Apps\code2flow-master\code2flowlib\languages\javascript.py", line 79, in __init__
    super(Group,self).__init__(**kwargs)
  File "C:\Users\xxx\Apps\code2flow-master\code2flowlib\engine.py", line 215, in __init__
    self.newObjectPattern = self.generateNewObjectPattern()
  File "C:\Users\xxx\Apps\code2flow-master\code2flowlib\languages\javascript.py", line 170, in generateNewObjectPattern
    return re.compile(r'new\s+%s\s*\('%self.name)
  File "C:\Python\2.7\lib\re.py", line 190, in compile
    return _compile(pattern, flags)
  File "C:\Python\2.7\lib\re.py", line 244, in _compile
    raise error, v # invalid expression
sre_constants.error: bogus escape: '\\2'

@scottrogowski
Copy link
Owner

Hey Christopher,

Sorry to take so long to get to this. Could you send over main.js and I can take a look?

@ChristopherRabotin
Copy link
Author

Hi Scott,

No problem. The code is here: http://pastebin.ca/UATjx4IX . The password is code2flow. My code uses classes, could that be a limitation of code2flow?

If you need a helping hand, I can see what I can do, I have about ten years of on and off experience with Python.

@scottrogowski
Copy link
Owner

Couldn't seem to reproduce the error. I run it like:
code2flow main.js
and it produces out.png. Were there some other variables or maybe it was a
different version of the file?

On Wed, Sep 11, 2013 at 12:52 AM, ChristopherRabotin <
notifications@github.com> wrote:

Hi Scott,

No problem. The code is here: http://pastebin.ca/UATjx4IX . The password
is code2flow. My code uses classes, could that be a limitation of code2flow?

If you need a helping hand, I can see what I can do, I have about ten
years of on and off experience with Python.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-24219225
.

@ChristopherRabotin
Copy link
Author

The issue was actually the (stupid) backslashes used in windows. In fact, I copied the source I wanted to graph directly into the folder where code2flow is. That worked without a problem. Thanks for the support.

@scottrogowski
Copy link
Owner

Awesome! Glad that worked. Thanks for the bug report!

On Sep 20, 2013, at 12:50 AM, ChristopherRabotin notifications@github.com wrote:

The issue was actually the (stupid) backslashes used in windows. In fact, I copied the source I wanted to graph directly into the folder where code2flow is. That worked without a problem. Thanks for the support.


Reply to this email directly or view it on GitHub.

@mr23
Copy link

mr23 commented Nov 6, 2014

Ugh. Just bit me trying to use code2flow with python3.4.2. Windows paths ugh.
Thanks ChristopherRabotin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants