Skip to content
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

read 표현식 진화 로드맵 #5

Open
RanolP opened this issue Nov 1, 2023 · 0 comments
Open

read 표현식 진화 로드맵 #5

RanolP opened this issue Nov 1, 2023 · 0 comments

Comments

@RanolP
Copy link
Member

RanolP commented Nov 1, 2023

read

유형의 값을 읽고 에 대입한 다음 즉시 그 값을 반환하는 표현식. 예시:

read i32 a
read i32 b
i32 sum = a + b

read with

타입 기본 파서가 없거나, 덮어쓰고자 할 떄 사용. 로 유형 값을 읽어 에 대입한 다음 즉시 그 값을 반환하는 표현식. 예시:

read str s with line

read

로 값을 읽어 반환하는 표현식. read 과 구분하기 귀찮으므로 나중에 구현

read ?

read가 <type> 대신 failble <type>을 반환하게 하기. failible의 자세한 스펙은 관련 이슈를 참조
목표는 다음과 같은 코드(eof나 형식 오류가 아닌 한 계속 읽는 while)를 작성할 수 있도록 하는 것

while read i32 command? {
    match command { ... }
}

각종 std parser combinator 지원

read eof, read whitespaces, read ':' 등등등

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant