Allow the file extension with EXEC SQL INCLUDE#147
Merged
yutaro-sakamoto merged 7 commits intoopensourcecobol:developfrom Jul 3, 2025
Merged
Allow the file extension with EXEC SQL INCLUDE#147yutaro-sakamoto merged 7 commits intoopensourcecobol:developfrom
EXEC SQL INCLUDE#147yutaro-sakamoto merged 7 commits intoopensourcecobol:developfrom
Conversation
allow adding extension in EXEC SQL INCLUDE
There was a problem hiding this comment.
Pull Request Overview
This PR updates the file name matching logic for the EXEC SQL INCLUDE statement to allow a file extension, changing the regular expression from INCFILE to a revised FILENAME pattern and updating the associated token handling. It also adds test coverage for this behavior and ensures that the include tests are executed via Makefile updates.
- Updated regex in ocesql/scanner.l to allow file extensions in file names.
- Replaced token usage from INCFILE to FILENAME to support the extended syntax.
- Added the missing include test to tests/Makefile.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/Makefile | Added basic.src/include.at to the test dependencies list. |
| ocesql/scanner.l | Updated regex and token handling to allow file extensions. |
yutaro-sakamoto
approved these changes
Jun 23, 2025
kio-watanabe
approved these changes
Jun 24, 2025
n-isaka
approved these changes
Jul 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The file name specified in
EXEC SQL INCLUDEcontains a file extension, which causes a syntax error, so the file can be precompiled and compiled in this format.Changes
scanner.l
↓
Tests
Add test cases to
basic/include.at.I have confirmed that it can be included even if the file extension is attached.
Miscellaneous
There were a few tests written in
include.atthat were not executed. So I have made the following changes:include.attotests/Makefile.tests/basicafter executingmakeintestsdirectory.