Skip to content

Add support for BEGINFILE and ENDFILE rules #457

@bertysentry

Description

@bertysentry

Jawk does not currently support gawk's BEGINFILE / ENDFILE rules, and the vendored gawk fixtures for that feature are present but not yet exercised by the metadata-driven IT harness.

Current coverage gap:

  • There is no existing BEGINFILE / ENDFILE support visible in the current source tree.
  • The vendored gawk resources include dedicated fixtures such as beginfile1.awk, beginfile2.ok, getfile.awk, getfile.ok, readfile2.awk, readfile2.ok, plus related diagnostics in lintwarn.ok and next.ok.
  • These tests are defined in gawk's handwritten src/it/resources/gawk/Makefile.am rules, not in generated Maketests, so they are not part of GawkCompatibilityIT yet.

We should add parser/runtime support for BEGINFILE and ENDFILE, then cover it with Jawk tests and compatibility-oriented integration tests.

Acceptance criteria:

  • Jawk parses and executes BEGINFILE and ENDFILE rules.
  • The rules fire once per input file with gawk-compatible FILENAME, ARGIND, and ERRNO behavior for the covered cases.
  • Representative vendored fixtures such as beginfile1, beginfile2, getfile, and readfile2 can be tested and pass.
  • Related restrictions and diagnostics around next and non-redirected getline inside BEGINFILE / ENDFILE are covered by tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions