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.
Add missed
ord()
, Fix small bug in reversing loop (lcompilers#767)
* Make `str()` work for non-constant values
- Loading branch information
1 parent
7aedd1a
commit 2677ef1
Showing
4 changed files
with
17 additions
and
5 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 80 {}) _lpython_main_program [] [(SubroutineCall 1 test_str_int () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 79 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), str@__lpython_overloaded_0__str: (ExternalSymbol 1 str@__lpython_overloaded_0__str 4 __lpython_overloaded_0__str lpython_builtin [] __lpython_overloaded_0__str Public), str@__lpython_overloaded_1__str: (ExternalSymbol 1 str@__lpython_overloaded_1__str 4 __lpython_overloaded_1__str lpython_builtin [] __lpython_overloaded_1__str Public), str@__lpython_overloaded_2__str: (ExternalSymbol 1 str@__lpython_overloaded_2__str 4 __lpython_overloaded_2__str lpython_builtin [] __lpython_overloaded_2__str Public), str@__lpython_overloaded_3__str: (ExternalSymbol 1 str@__lpython_overloaded_3__str 4 __lpython_overloaded_3__str lpython_builtin [] __lpython_overloaded_3__str Public), test_str_int: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 2 str 4 str lpython_builtin [] str Private)}) test_str_int [] [(= (Var 2 s) (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerConstant 356 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "356" (Character 1 1 () [])) ()) ()) (Assert (StringCompare (Var 2 s) Eq (StringConstant "356" (Character 1 3 () [])) (Logical 4 []) ()) ()) (= (Var 2 s) (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerUnaryMinus (IntegerConstant 567 (Integer 4 [])) (Integer 4 []) (IntegerConstant -567 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-567" (Character 1 1 () [])) ()) ()) (Assert (StringCompare (Var 2 s) Eq (StringConstant "-567" (Character 1 4 () [])) (Logical 4 []) ()) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerConstant 4 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "4" (Character 1 1 () [])) ()) Eq (StringConstant "4" (Character 1 1 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-5" (Character 1 1 () [])) ()) Eq (StringConstant "-5" (Character 1 2 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_0__str 2 str [] (Character 1 -2 () []) (StringConstant "" (Character 1 1 () [])) ()) Eq (StringConstant "" (Character 1 0 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_1__str 2 str [((StringConstant "1234" (Character 1 4 () [])))] (Character 1 -2 () []) (StringConstant "1234" (Character 1 1 () [])) ()) Eq (StringConstant "1234" (Character 1 4 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_2__str 2 str [((LogicalConstant .false. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "False" (Character 1 1 () [])) ()) Eq (StringConstant "False" (Character 1 5 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_2__str 2 str [((LogicalConstant .true. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "True" (Character 1 1 () [])) ()) Eq (StringConstant "True" (Character 1 4 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ())] Source Public Implementation () .false. .false.)}) []) | ||
(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 81 {}) _lpython_main_program [] [(SubroutineCall 1 test_str_int () [] ()) (SubroutineCall 1 str_conv_for_variables () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 80 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), str@__lpython_overloaded_0__str: (ExternalSymbol 1 str@__lpython_overloaded_0__str 5 __lpython_overloaded_0__str lpython_builtin [] __lpython_overloaded_0__str Public), str@__lpython_overloaded_1__str: (ExternalSymbol 1 str@__lpython_overloaded_1__str 5 __lpython_overloaded_1__str lpython_builtin [] __lpython_overloaded_1__str Public), str@__lpython_overloaded_2__str: (ExternalSymbol 1 str@__lpython_overloaded_2__str 5 __lpython_overloaded_2__str lpython_builtin [] __lpython_overloaded_2__str Public), str@__lpython_overloaded_3__str: (ExternalSymbol 1 str@__lpython_overloaded_3__str 5 __lpython_overloaded_3__str lpython_builtin [] __lpython_overloaded_3__str Public), str_conv_for_variables: (Subroutine (SymbolTable 3 {str: (ExternalSymbol 3 str 5 str lpython_builtin [] str Private), x: (Variable 3 x Local () () Default (Integer 4 []) Source Public Required .false.)}) str_conv_for_variables [] [(= (Var 3 x) (IntegerConstant 123 (Integer 4 [])) ()) (Assert (StringCompare (StringConstant "123" (Character 1 3 () [])) Eq (FunctionCall 1 str@__lpython_overloaded_3__str 3 str [((Var 3 x))] (Character 1 -2 () []) () ()) (Logical 4 []) ()) ()) (= (Var 3 x) (IntegerConstant 12345 (Integer 4 [])) ()) (Assert (StringCompare (StringConstant "12345" (Character 1 5 () [])) Eq (FunctionCall 1 str@__lpython_overloaded_3__str 3 str [((Var 3 x))] (Character 1 -2 () []) () ()) (Logical 4 []) ()) ()) (= (Var 3 x) (IntegerUnaryMinus (IntegerConstant 12 (Integer 4 [])) (Integer 4 []) (IntegerConstant -12 (Integer 4 []))) ()) (Assert (StringCompare (StringConstant "-12" (Character 1 3 () [])) Eq (FunctionCall 1 str@__lpython_overloaded_3__str 3 str [((Var 3 x))] (Character 1 -2 () []) () ()) (Logical 4 []) ()) ()) (= (Var 3 x) (IntegerUnaryMinus (IntegerConstant 121212 (Integer 4 [])) (Integer 4 []) (IntegerConstant -121212 (Integer 4 []))) ()) (Assert (StringCompare (StringConstant "-121212" (Character 1 7 () [])) Eq (FunctionCall 1 str@__lpython_overloaded_3__str 3 str [((Var 3 x))] (Character 1 -2 () []) () ()) (Logical 4 []) ()) ())] Source Public Implementation () .false. .false.), test_str_int: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 2 str 5 str lpython_builtin [] str Private)}) test_str_int [] [(= (Var 2 s) (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerConstant 356 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "356" (Character 1 1 () [])) ()) ()) (Assert (StringCompare (Var 2 s) Eq (StringConstant "356" (Character 1 3 () [])) (Logical 4 []) ()) ()) (= (Var 2 s) (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerUnaryMinus (IntegerConstant 567 (Integer 4 [])) (Integer 4 []) (IntegerConstant -567 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-567" (Character 1 1 () [])) ()) ()) (Assert (StringCompare (Var 2 s) Eq (StringConstant "-567" (Character 1 4 () [])) (Logical 4 []) ()) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerConstant 4 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "4" (Character 1 1 () [])) ()) Eq (StringConstant "4" (Character 1 1 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_3__str 2 str [((IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-5" (Character 1 1 () [])) ()) Eq (StringConstant "-5" (Character 1 2 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_0__str 2 str [] (Character 1 -2 () []) (StringConstant "" (Character 1 1 () [])) ()) Eq (StringConstant "" (Character 1 0 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_1__str 2 str [((StringConstant "1234" (Character 1 4 () [])))] (Character 1 -2 () []) (StringConstant "1234" (Character 1 1 () [])) ()) Eq (StringConstant "1234" (Character 1 4 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_2__str 2 str [((LogicalConstant .false. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "False" (Character 1 1 () [])) ()) Eq (StringConstant "False" (Character 1 5 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (StringCompare (FunctionCall 1 str@__lpython_overloaded_2__str 2 str [((LogicalConstant .true. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "True" (Character 1 1 () [])) ()) Eq (StringConstant "True" (Character 1 4 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ())] Source Public Implementation () .false. .false.)}) []) |