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

Ignore goto at REGEX_TYPE #55

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions c_formatter_42/formatters/helper.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# ############################################################################ #
# **************************************************************************** #
# #
# ::: :::::::: #
# helper.py :+: :+: :+: #
# +:+ +:+ +:+ #
# By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ #
# By: kiokuless <me[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/10/04 11:38:00 by cacharle #+# #+# #
# Updated: 2021/02/08 18:22:06 by charles ### ########.fr #
# Updated: 2023/07/17 02:28:52 by kiokuless ### ########.fr #
# #
# ############################################################################ #
# **************************************************************************** #

import re

# regex for a type
REGEX_TYPE = r"(?!return)([a-z]+\s+)*[a-zA-Z_]\w*"
REGEX_TYPE = r"(?!return|goto)([a-z]+\s+)*[a-zA-Z_]\w*"
# regex for a c variable/function name
REGEX_NAME = r"\**[a-zA-Z_*()]\w*"
# regex for a name in a declaration context (with array and function ptr)
Expand Down