Fix similar function header parsing error #75
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
다음의 경우에 재현되는 오류임
이 경우에, ValueLiteral이 아닌 값(3에서 인자에 전달한 값)은 아직
Node[]
로 평가되기에 Evaluable이 되지 않아 의도한 함수 호출 파싱이 진행되지 않음. 이후 작은 함수 헤더가 먼저 파싱이 진행되어, 이후 큰 함수는 올바르게 파싱되지 않음.현재 파싱 규칙은 DynamicRules -> BasicRules -> AdvancedRules(Statements) 순서로 진행됨. 이중 함수 호출 & 정의는 DynamicRules에 정의되며, 이를 BasicRules 이후로 미룰 필요가 있었음. 그렇기에 BasicRules -> DynamicRules -> AdvancedRules 순서로 파싱 우선순위를 변경하였음.
그러나 이 경우 함수(약속, 번역) 정의에서 문제가 발생함. 정의문의 일부가 BasicRules로 파싱되는 경우가 발생하여, 이를 방지하지 위해 함수 정의는 따로 분리하여 BasicRules보다 먼저 파싱할 필요가 생겼음. 그렇기에 DynamicRules를 생성하는 함수에서 1순위와 차순위를 분리하여, 1순위엔 함수 정의 문법을 포함함.
이후 파싱 규칙을 DeclareRules -> BasicRules -> InvokingRules -> AdvancedRules 순서로 수정하여, 올바르게 파싱되는 것을 확인함.