A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1810 below:

[python] [cpd] Parse error when using Python 2 backticks · Issue #1810 · pmd/pmd · GitHub

Example:

test = 'hello'
quoted = `test`
print quoted

Parse Error:

Stacktrace
net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file CODE_LOADED_FROM_STRING at line 2, column 10.  Encountered: "`" (96), after : ""
	at net.sourceforge.pmd.lang.python.ast.PythonParserTokenManager.getNextToken(PythonParserTokenManager.java:3763)
	at net.sourceforge.pmd.lang.python.PythonTokenManager.getNextToken(PythonTokenManager.java:31)
	at net.sourceforge.pmd.cpd.token.internal.BaseTokenFilter.getNextToken(BaseTokenFilter.java:30)
	at net.sourceforge.pmd.cpd.internal.JavaCCTokenizer.tokenize(JavaCCTokenizer.java:40)
	at net.sourceforge.pmd.cpd.PythonTokenizerTest.testBackticks(PythonTokenizerTest.java:64)

Backticks are delimiters in Python 2:
https://docs.python.org/2.7/reference/lexical_analysis.html#delimiters

Note: In Python3 this is not anymore the case: https://docs.python.org/3/reference/lexical_analysis.html#delimiters

The PR #1802 fixes this.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4