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

Bython parser improvement #31

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
179ce3a
c++ style single line comments implemented
filipefjn May 15, 2019
305e8ac
started the implementation of a recursive parser
filipefjn May 16, 2019
f658382
added '#' scope on recursive parser
filipefjn May 16, 2019
d64fe83
recommited all the changes with my name set on git
filipefjn May 16, 2019
091f466
Merge branch 'master' of https://github.com/filipefjn/bython
filipefjn May 16, 2019
1fab9b0
implemented tests for: comments (c, c++ and python styled), strings (…
filipefjn May 16, 2019
6af238d
unified the global and brace scopes conditional
filipefjn May 16, 2019
4a12556
outputting the .py file for the first time
filipefjn May 17, 2019
a4d6e9c
implemented a function for removing indentation
filipefjn May 17, 2019
070f19a
implemented functions for preparing braces and removing empty lines. …
filipefjn May 17, 2019
a5ca359
implemented indentation
filipefjn May 17, 2019
2713ce1
fixed python dicts
filipefjn May 17, 2019
a349d6c
fixed error when there's a comment after a call and before the openin…
filipefjn May 20, 2019
daa7e3e
implemented the removal of semicolons
filipefjn May 20, 2019
83ed356
fixed double indentation and wrong indentation after dict
filipefjn May 20, 2019
6825876
implemented multi-line comments
filipefjn May 20, 2019
5041fa2
fixed doubled character after non-dicts
filipefjn May 20, 2019
d870bd1
disabled the remove_semicolons for now
filipefjn May 20, 2019
5e9cd48
added some comments and minor fixes
filipefjn May 23, 2019
ca0ce33
fixed a few cases where comments would be removed
filipefjn May 24, 2019
258af8a
renamed a function to parse_file_recursively
filipefjn May 24, 2019
69bb5bf
added a debug mode
filipefjn May 24, 2019
e86c6a7
preparing for first release
filipefjn May 24, 2019
cf452c7
disabled one regex substitution and fixed an infinite loop
filipefjn May 24, 2019
d1aeeae
implemented a debug option for the cli
filipefjn May 24, 2019
611c1c2
fixed empty lines bug. filtered file now only appears when debug mode…
filipefjn May 25, 2019
5b69929
fixed '} else {'
filipefjn May 25, 2019
ffc4a9c
implemented parenthesis scope
filipefjn May 25, 2019
1ed72b6
added function descriptions and more comments
filipefjn May 26, 2019
65d15d2
put my name in the authors
filipefjn May 26, 2019
5dcc5cc
fixed infinite loop inside "/*" scope
filipefjn May 26, 2019
b35ca4c
Fixed an exception that happened when the file didn't end with a newline
filipefjn May 30, 2019
d3da4c5
Fixed an issue where the code was being duplicated
filipefjn May 30, 2019
3f38de3
Fixed an issue where spaces and tabs after closing braces were remove…
filipefjn May 30, 2019
311329c
else and elif fix
filipefjn Jun 7, 2019
8fdadbf
I just found out that python has a '//' operator. Disabling '//' comm…
filipefjn Jun 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed error when there's a comment after a call and before the openin…
…g brace
filipefjn committed May 20, 2019
commit a349d6c4908b6f8b3f61a16c72cbee3ea53a2684
7 changes: 3 additions & 4 deletions bython/parser.py
Original file line number Diff line number Diff line change
@@ -189,10 +189,9 @@ def remove_indentation(code):


def prepare_braces(code):
# TODO fix issue with comment on the line before the brace
# TODO fix issue with brance within comments
code = re.sub(r" \{", "{", code)
code = re.sub(r"[ \t]*\r?\n[ \t]*\{", "{", code)
# TODO fix issue with brace within comments
code = re.sub(r"[ \t]*\{", "{", code)
code = re.sub(r"[ \t]*(\/\/.*)?(\#.*)?\r?\n[ \t]*{", "{", code)
code = re.sub(r"\{", "{\n", code)
return code