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

Syntax error / typo in ngc_expr.c #527

Open
MitchBradley opened this issue Jun 1, 2024 · 3 comments
Open

Syntax error / typo in ngc_expr.c #527

MitchBradley opened this issue Jun 1, 2024 · 3 comments

Comments

@MitchBradley
Copy link

Line 794 of ngc_expr.c is:

                if((stack_index > 1) && precedence(operators[stack_index - 1] <= precedence(operators[stack_index - 2])))

I think there is a misplaced closing parenthesis. It should be

                if((stack_index > 1) && precedence(operators[stack_index - 1]) <= precedence(operators[stack_index - 2]))
@terjeio
Copy link
Contributor

terjeio commented Jun 2, 2024

Good catch!
I (or someone else?) should write a comprehensive test suite for the parameters/expressions/flow control part of the core...

@MitchBradley
Copy link
Author

Thank the C++ compiler for catching it. I tried compiling with C++ and the stricter type coercion revealed the problem.

I think there might also be an issue with EXISTS[]. LinuxCNC says that the syntax is EXISTS[#<_name>], but as I read the code, it is looking for e.g. EXISTS[_name] without the enclosing #<>.

@terjeio
Copy link
Contributor

terjeio commented Jun 3, 2024

I think there might also be an issue with EXISTS[].

You are correct, I will fix this in the next commit.

terjeio added a commit that referenced this issue Jun 4, 2024
Added missing clear of parser tool change state when cycle start signal is asserted.
Affects tool change mode 'Normal' ($341=0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants