forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lcompilers#624 from akshanshbhatt/fstring
[Parser] Add support for parsing prefixed strings
- Loading branch information
Showing
6 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
f"Hello, {first_name} {last_name}. You are {age} years old." | ||
|
||
print(f"{__file__} executed in {elapsed} seconds.") | ||
|
||
# TODO: Support format specifiers | ||
|
||
# print(f"{__file__} executed in {elapsed:0.2f} seconds.") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"basename": "ast_new-string1-96b90b3", | ||
"cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", | ||
"infile": "tests/parser/string1.py", | ||
"infile_hash": "e51ab7a60ad39354a13d987f0ed3bdb8f51b8e6d2a677a9d7b720749", | ||
"outfile": null, | ||
"outfile_hash": null, | ||
"stdout": "ast_new-string1-96b90b3.stdout", | ||
"stdout_hash": "00a9b4899bd6ba7938b503da224840f51e2e7ba2e41121292809bdf2", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(Module [(Expr (JoinedStr [(ConstantStr "Hello, " ()) (FormattedValue (Name first_name Load) -1 ()) (ConstantStr " " ()) (FormattedValue (Name last_name Load) -1 ()) (ConstantStr ". You are " ()) (FormattedValue (Name age Load) -1 ()) (ConstantStr " years old." ())])) (Expr (Call (Name print Load) [(JoinedStr [(FormattedValue (Name __file__ Load) -1 ()) (ConstantStr " executed in " ()) (FormattedValue (Name elapsed Load) -1 ()) (ConstantStr " seconds." ())])] []))] []) |
This file contains 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