[Github-comments] [geany/geany] Add support for Kotlin tags (PR #3034)

Jiří Techet notifications at xxxxx
Mon Dec 6 17:12:32 UTC 2021


@techee commented on this pull request.



> -        shutil.copy('parsers/' + f, dstdir + '/parsers/' + f)
-    elif os.path.exists(f):
-        shutil.copy(f, dstdir + '/parsers/' + f)
-    else:
-        print('Error: Could not find file ' + f + '!')
-        sys.exit(1)
+    shutil.copy(f, dstdir + '/parsers')
+
+os.chdir(dstdir + '/peg')
+peg_dst_files = glob.glob('*.c') + glob.glob('*.h')
+peg_dst_files = list(filter(lambda x: not x.startswith('geany_'), peg_dst_files))
+os.chdir(srcdir + '/peg')
+os.system('make -C {} peg/{}'.format(srcdir, ' peg/'.join(peg_dst_files)))
+print('Copying peg parsers... ({} files)'.format(len(peg_dst_files)))
+for f in peg_dst_files:
+    shutil.copy(f, dstdir + '/peg')

Since the code does more or less the same thing twice, it could be changed to something like the following:

```
os.chdir(srcdir + '/peg')
os.system('make -C {} peg/{}'.format(srcdir, ' peg/'.join(peg_dst_files)))
for dir in ['parsers', 'peg']:
    ...
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3034#pullrequestreview-824230861
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211206/970164e6/attachment.htm>


More information about the Github-comments mailing list