diff --git a/analysis-plugins/contracts/python/codecrow_plugins/graphql.py b/analysis-plugins/contracts/python/codecrow_plugins/graphql.py index 129e5fd1..a8eebb3f 100644 --- a/analysis-plugins/contracts/python/codecrow_plugins/graphql.py +++ b/analysis-plugins/contracts/python/codecrow_plugins/graphql.py @@ -9,7 +9,10 @@ _TOKEN = re.compile( r"(?P\s+)" r"|(?P\#[^\r\n]*)" - r"|(?P\"\"\"(?:.|\n)*?\"\"\")" + # DOTALL already makes ``.`` consume newlines. ``(?:.|\n)`` gave the + # regex engine two ways to consume every newline and caused exponential + # backtracking on Java text blocks that were not GraphQL documents. + r"|(?P\"\"\".*?\"\"\")" r"|(?P