Skip to content
Permalink
Browse files

Update normalizeFortranFile.py

Make square-bracketed array notation no longer throw an error:

```
integer, dimension(3), parameter :: a = [1, 2, 3]
```

Protect against more silliness and fix #765
  • Loading branch information
oerc0122 authored and dev-zero committed Feb 6, 2020
1 parent 9cabac6 commit 4574fad5dc5f4316649a65701c5fb3c0dd248243
Showing with 1 addition and 1 deletion.
  1. +1 −1 tools/prettify/prettify_cp2k/normalizeFortranFile.py
@@ -9,7 +9,7 @@
from io import StringIO

VAR_RE = re.compile(
r" *(?P<var>[a-zA-Z_0-9]+) *(?P<rest>(?:\((?P<param>(?:[^()]+|\((?:[^()]+|\([^()]*\))*\))*)\))? *(?:= *(?P<value>(:?[^\"',()]+|\((?:[^()\"']+|\([^()\"']*\)|\"[^\"]*\"|'[^']*')*\)|\"[^\"]*\"|'[^']*')+))?)? *(?:(?P<continue>,)|\n?) *",
r" *(?P<var>[a-zA-Z_0-9]+) *(?P<rest>(?:\((?P<param>(?:[^()]+|\((?:[^()]+|\([^()]*\))*\))*)\))? *(?:= *(?P<value>(?:[^\"',()\[\]]+|\[(?:[^()\"'\[\]]+|\([^()\"']*\)|\"[^\"]*\"|'[^']*')*\]|\((?:[^()\"'\[\]]+|\([^()\"']*\)|\"[^\"]*\"|'[^']*')*\)|\"[^\"]*\"|'[^']*')+))?)? *(?:(?P<continue>,)|\n?) *",
re.IGNORECASE,
)
USE_PARSE_RE = re.compile(

0 comments on commit 4574fad

Please sign in to comment.
You can’t perform that action at this time.