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

Исправлена ошибка разбор условия препроцессора #214

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alkoleft
Copy link

Исправлена ошибка разбор условия препроцессора с отрицанием вложенного условия

#IF NOT Server OR NOT(ExternalConnection OR ExternalConnection) THEN
#EndIf

Подобная инструкция препроцессора ломала разбор

с отрицанием вложенного условия
@@ -49,9 +49,10 @@ preproc_expression
| preproc_logicalExpression
;
preproc_logicalOperand
: (PREPROC_LPAREN PREPROC_NOT_KEYWORD? preproc_logicalOperand PREPROC_RPAREN)
: (PREPROC_NOT_KEYWORD? PREPROC_LPAREN preproc_logicalOperand PREPROC_RPAREN)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне не очень нравится вынос NOT за скобки. Может случиться неоднозначный парсинг. В старой схеме NOT стоит либо внутри скобок перед рекурсивным логическим операндом, либо перед символом препроцессора. Если оставить на первой строке старый вариант, но добавить на 54 строку необязательный NOT после LPAREN, не решится эта же проблема?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Проверю, но скорее всего вообще такой вариант не используется. Раз до этого не поймали.

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

Successfully merging this pull request may close these issues.

2 participants