Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

parser: "expression nesting too deep" never reaches the first-error recorder (LSP/--lint show a cascade instead)

Đang mở
#1,342 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
compilers, testing

Hướng nghiên cứu

Start in src/parser.c at the PARSE_MAX_DEPTH guards in parse_unary and parse_expression, then run the deep.eigs reproduction with --lint --json. Add regression coverage in tests/test_lsp.py or the --lint suite for the current-token location, message, length, and precedence when both limits trip; done means the reported error is expression nesting too deep and the existing #943 f-string checks still pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs-triage

Repro

python3 -c "print('x is ' + '(' * 300 + '1' + ')' * 300)" > deep.eigs
src/eigenscript deep.eigs            # stderr: Parse error line 1: expression nesting too deep  (plus cascades)
src/eigenscript --lint --json deep.eigs

--lint --json and the LSP publish only the first recorded error. The PARSE_MAX_DEPTH guards in parse_unary and parse_expression (src/parser.c) call fprintf and g_parse_errors++, but never eigs_record_first_error*. As a result, the published diagnostic is whatever recovery cascade comes after it (for example expected ')', got '('), not the actual cause. I found this while working on #1331 (the 65-level f-string case from #943).

Done when

  • Both PARSE_MAX_DEPTH guards record the error at the current token's line and column (and length).
  • --lint --json on the repro reports expression nesting too deep as its error, not a cascade.
  • A regression test in tests/test_lsp.py (or the --lint suite) fails with the fix reverted.
  • The #943 f-string depth checks in tests/test_lsp.py still pass. Decide which message wins when both limits trip on one line, and write that decision in the test.
Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
3 giờ 58 phút
Pull request đã merge (30 ngày)
105

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.