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

Support try expression #254

Merged
merged 3 commits into from
Jul 17, 2019
Merged

Support try expression #254

merged 3 commits into from
Jul 17, 2019

Conversation

yoshihiro503
Copy link
Contributor

@yoshihiro503 yoshihiro503 commented Jun 10, 2019

Fix #223
This is a simple implementation of try expression and does not support catch clauses.

  • Does not change Ast.t
  • All catch clauses are ignored
  • Translate try expression to a case expression or a more simple expressions

For the full support of try expression, implements about catch clauses : #252.

simple try expressions

    try
        <exprs>
    catch
        <catch-clauses>
    end.

[<exprs>]

try expressions with pattern clauses (with an of section)

    try
        <exprs>
    of
        <case-clauses>
    catch
        <catch-clauses>
    end.

Case(line, [<exprs>], [<case-clauses>])

try expressions with an after section

    try
        <exprs>
    catch
        <catch-clauses>
    after
        <after>
    end.

Let(line, "_", [<exprs>], [<after>])

@yoshihiro503 yoshihiro503 force-pushed the support_try_expression branch from a93d84b to df90cd5 Compare June 26, 2019 01:54
@yoshihiro503 yoshihiro503 force-pushed the support_try_expression branch from df90cd5 to 505180c Compare July 10, 2019 08:41
@yoshihiro503 yoshihiro503 merged commit f2643aa into master Jul 17, 2019
@yoshihiro503 yoshihiro503 deleted the support_try_expression branch July 17, 2019 06:42
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

Successfully merging this pull request may close these issues.

Support try and catch expression
1 participant