GLR feature needs to be usable without command line args

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

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
haskell
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu bằng cách lần theo cách Happy đọc các tùy chọn dòng lệnh GLR, --decode và --filter, cũng như cách nó phân tích các chỉ thị hiện có như %name. Xác định cách biểu diễn và kiểm tra tính hợp lệ của các chỉ thị tương đương trong từng tệp .y, sau đó xác minh rằng người dùng Cabal có thể chọn các hành vi này mà không cần đối số dòng lệnh.

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

Mô tả

The GLR feature in Happy is currently not usable for people using cabal (ie everyone) because the GLR feature requires the use of command line arguments, and Cabal provides no way to set happy command line arguments in the .cabal file.

Now you may say "well then, cabal should just let me specify command line arguments to happy". But actually this behaviour in Cabal is by design. The right place to say if your parser is GLR or not is in the .y file itself, not in the .cabal file. In practice each .y file is either going to be GLR or not, and this is something that is decided by the author, not the person building the package.

Exactly how you do this is up to you of course, but happy already has a syntax for directives, like %name, so you could just add something like

%grammar glr

and similarly for the functionality of the --decode and --filter options.

The general principle here, is to consider that there is a division of roles between the author of the program/package and the person building the package. The person building can decide things like optimisation levels, where input and output files live etc. The author decides the code and anything that is necessary for the meaning of that code. The preferable place to put the code (and related) is in the file itself, or sometimes in the .cabal file, but the less configuration the better. The preferable place for the builder to specify things is in the build environment (cabal command line, cabal config file, sandbox config file etc).

Ngôn ngữ chính
Haskell
Star
323
Fork
88
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

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 haskell/happy

Tất cả issue của haskell/happy

Issue tương tự

Thêm issue về Haskell

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.