-
Notifications
You must be signed in to change notification settings - Fork 9
Adding Constants #61
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
base: master
Are you sure you want to change the base?
Adding Constants #61
Changes from all commits
cd3d567
8522612
d4fd8bb
8363bdb
f959243
54ffb66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ function <name> ( <parameter-list> ) : \n <statement-list> | |
|
|
||
| <assignment> is | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Мы же обсуждали изменение вида Соответственно, тогда понятно, что в parser.d меняется одна функция:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Честно говоря, я не особо понимаю как работать с подобной грамматикой |
||
| <variable> <assign-op> <expression0> | ||
| const <variable> <assign-op> <expression0> | ||
|
|
||
| <variable> is | ||
| <name> | ||
|
|
@@ -120,4 +121,4 @@ if <expression0> : \n <statement-list> \n <elif-block> | |
| <elif-block> is | ||
| elif <expression0> : \n <statement-list> | ||
| elif <expression0> : \n <statement-list> \n else \n <statement-list> | ||
| elif <expression0> : \n <statement-list> \n <elif-block> | ||
| elif <expression0> : \n <statement-list> \n <elif-block> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хмм, то есть мы можем сделать переменную константой в середине работы программы? Это странно, и выглядит скорее как баг, чем как фича...
В принципе я видел такую идиому в Rust. Но здесь, считаю, гораздо вероятнее, что программист ошибся и хотел создать новую константу во внутреннем контексте, чем что он хотел сделать константой существующую переменную.