Repository navigation
feat(parser)!: assign with 이에요 like a declaration, remove 넣다 - #53
Merged
Merged
Conversation
`NAME은/는 VALUE이에요/예요` on a name already declared in the block or a block around it now gives that variable a new value: the converter turns the Init into an assignment, with the type and 고정된 checks of before. A type (`가는 정수예요`) or 고정된 on a declared name stays an error. The value of a declaration takes a whole chain, its last verb in the adnominal form before 값 (`결과는 3과 4를 더해서 제곱한 값이에요`), latin verbs included (`printf한 값`), so every 넣어요 chain has its form. 넣다 is no built-in verb any more: the Assign statement, put() and the PutArguments error are gone. Samples, specs, READMEs and the design doc are rewritten in the new form; the shadowing error samples now use a type, the only redeclaration still refused. BREAKING CHANGE: `X에 V를 넣어요` no longer compiles: write `X는 V예요`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An assignment is now written like a declaration:
NAME은/는 VALUE이에요/예요on a name already declared in the block or a block around it gives that variable a new value, of its type. There is still no shadowing.값, latin verbs included (printf한 값), so every former넣어요chain has its form.'개수' has the type 정수, not 소수) and a고정된variable are refused as before. A type (개수는 정수예요) or고정된on a declared name staysalready declared.넣다is no built-in verb any more: theAssignstatement,put()andPutArgumentsare gone. The message on a lone=now points to가는 1이에요.Proto.kr, the READMEs anddocs/LANGUAGE_DESIGN.mdare rewritten in the new form.sample/errors/assign_without_target.kris deleted;already_declared,shadow_in_blockandshadow_parameternow redeclare with a type, the only redeclaration still refused.Breaking change:
X에 V를 넣어요no longer compiles, writeX는 V예요.Checked:
cargo test(1386 passed),cargo clippy(no warning),scripts/run_samples.sh(61 passed). The migrated specs that still fail wait for their own issue (#2, #5, #6, #10, #20).Makes #49 and #50 obsolete (closed).