-
Notifications
You must be signed in to change notification settings - Fork 1
Add CI/CD, linting infrastructure, and parser error recovery #17
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
Conversation
- Add builtins for self-hosting: args(), exec(), exec_output(), mkdir(), append_file(), getenv(), setenv() - Fix char comparison to compare values instead of pointers - Fix escape sequence processing in char and string literals - Add bootstrap lexer in Carv (examples/bootstrap/lexer.carv) - Add test coverage for pkg/ast, pkg/codegen, pkg/module
- Add parse_int() and parse_float() builtins for string-to-number conversion
- Add index assignment support for arrays and maps (arr[i] = val, map[key] = val)
- Add bootstrap parser written in Carv (examples/bootstrap/parser.carv)
- Uses Pratt parsing (recursive descent with operator precedence)
- Parses all Carv constructs: functions, classes, let/const, if/else,
for/for-in/while, match, pipe operator, etc.
- AST nodes represented as maps for simplicity
- Add test file (examples/bootstrap/test_simple.carv)
This is an experimental branch for self-hosting exploration.
- Add GitHub Actions workflow for test, lint, build, and release - Add golangci-lint configuration with sensible defaults - Update Makefile with lint, lint-fix, and check targets - Fix linting issues: octal literals, error handling, unused code - Add parser synchronize() for error recovery to report multiple errors - Use errors.As for proper wrapped error handling in builtins
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR establishes comprehensive Carv language infrastructure: adds GitHub Actions CI/CD automation with testing, linting, and release pipelines; implements a bootstrap parser and lexer; extends the runtime with CLI argument passing, process execution, and filesystem utilities; improves parser robustness via error recovery; and adds extensive test coverage across AST, code generation, module system, and parser components. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Changes
CI/CD Pipeline (
.github/workflows/ci.yml)go testwith race detection and coverageLinting Infrastructure
.golangci.ymlwith errcheck, errorlint, gofmt, govet, staticcheck, etc.Makefilewithlint,lint-fix, andchecktargetsCode Fixes
0644→0o644) for modern Go styleerrors.Asinstead of type assertions for wrapped errorsfunctionsfield in CGenerator,inferResultExprTypefunction)max→maxIdx,filepath→execPath)filepath.AbsandFindProjectRootParser Error Recovery
synchronize()function to skip to the next statement boundary on parse errorsVerification
go test ./...golangci-lint run ./...Summary by CodeRabbit
Release Notes
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.