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

Limited string templates: \(identifier) #3585

Merged

Conversation

RZhang05
Copy link
Contributor

@RZhang05 RZhang05 commented Sep 19, 2024

Working towards #3579

Description

Implementation of onflow/flips#289

This PR introduces a simple string template in the form "\(foo)", with plans to extend for expressions later.


  • Targeted PR against feature/string-templates branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@RZhang05
Copy link
Contributor Author

Opened for early feedback.

  • Need to add more tests across all stages of the feature
  • Implementation questions marked with STRINGTODO in the code
  • Further consider handling (or lack of handling) of error cases in the lexer and parser

@RZhang05 RZhang05 mentioned this pull request Sep 20, 2024
6 tasks
runtime/parser/lexer/lexer.go Outdated Show resolved Hide resolved
runtime/parser/lexer/lexer.go Outdated Show resolved Hide resolved
@RZhang05 RZhang05 marked this pull request as ready for review September 25, 2024 17:59
@RZhang05 RZhang05 requested a review from turbolent as a code owner September 25, 2024 17:59
runtime/ast/expression.go Outdated Show resolved Hide resolved
runtime/ast/expression.go Outdated Show resolved Hide resolved
runtime/interpreter/interpreter_expression.go Outdated Show resolved Hide resolved
runtime/tests/interpreter/interpreter_test.go Show resolved Hide resolved
runtime/sema/check_string_template_expression.go Outdated Show resolved Hide resolved
runtime/parser/lexer/lexer.go Outdated Show resolved Hide resolved
runtime/parser/lexer/lexer.go Outdated Show resolved Hide resolved
runtime/parser/expression_test.go Show resolved Hide resolved
runtime/parser/expression.go Show resolved Hide resolved
runtime/parser/lexer/state.go Show resolved Hide resolved
@SupunS SupunS self-assigned this Oct 1, 2024
Copy link
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just some minor cleanups

runtime/parser/expression.go Outdated Show resolved Hide resolved
runtime/parser/lexer/lexer.go Outdated Show resolved Hide resolved
runtime/sema/check_string_template_expression.go Outdated Show resolved Hide resolved
runtime/parser/expression.go Show resolved Hide resolved
runtime/sema/check_string_template_expression.go Outdated Show resolved Hide resolved
Copy link
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 🎉

runtime/sema/elaboration.go Outdated Show resolved Hide resolved
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

runtime/ast/expression.go Show resolved Hide resolved
runtime/ast/expression.go Outdated Show resolved Hide resolved
runtime/parser/lexer/lexer.go Outdated Show resolved Hide resolved
runtime/sema/check_string_template_expression.go Outdated Show resolved Hide resolved
@turbolent
Copy link
Member

Can you please update the title to reflect the current proposal (e.g. description)?

@RZhang05 RZhang05 changed the title Limited string templates: $identifier Limited string templates: \(identifier) Oct 16, 2024
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress! Only a couple minor issues left. Once resolved, this should be ready to get merged 👏

runtime/ast/expression.go Outdated Show resolved Hide resolved
runtime/ast/expression.go Show resolved Hide resolved
runtime/ast/expression.go Outdated Show resolved Hide resolved
runtime/tests/checker/string_test.go Outdated Show resolved Hide resolved
runtime/sema/check_string_template_expression.go Outdated Show resolved Hide resolved
runtime/sema/check_string_template_expression.go Outdated Show resolved Hide resolved
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 👏

@SupunS SupunS merged commit 3208a5d into onflow:feature/string-templates Oct 18, 2024
8 of 9 checks passed
@RZhang05 RZhang05 deleted the identifier-string-template branch October 18, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants