From e3de4354b3eecc7da3487fcd78f60b0c2266822e Mon Sep 17 00:00:00 2001 From: Thirumalai-Shaktivel Date: Sat, 10 Jul 2021 21:02:57 +0530 Subject: [PATCH 1/3] AST: Parse letter_spec_list --- grammar/AST.asdl | 2 +- src/lfortran/ast_to_src.cpp | 8 ++++++++ src/lfortran/parser/parser.yy | 15 +++++++++++++++ src/lfortran/parser/semantics.h | 6 +++++- tests/implicit1.f90 | 7 ++++++- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/grammar/AST.asdl b/grammar/AST.asdl index dbd0cea635..1f4c9064d6 100644 --- a/grammar/AST.asdl +++ b/grammar/AST.asdl @@ -90,7 +90,7 @@ import_modifier implicit_statement = ImplicitNone(implicit_none_spec* specs) - | Implicit(decl_attribute type, letter_spec* specs) + | Implicit(decl_attribute type, letter_spec* spec, letter_spec* specs) implicit_none_spec = ImplicitNoneExternal(int dummy) diff --git a/src/lfortran/ast_to_src.cpp b/src/lfortran/ast_to_src.cpp index 2bca8cd7d1..1fd5bc7c97 100644 --- a/src/lfortran/ast_to_src.cpp +++ b/src/lfortran/ast_to_src.cpp @@ -889,6 +889,14 @@ class ASTToSRCVisitor : public BaseVisitor r += " "; visit_decl_attribute(*x.m_type); r += s; + if (x.n_spec > 0) { + r += " ("; + for (size_t i=0; i 0) { r += " ("; for (size_t i=0; i(t), \ + down_cast(t), nullptr, 0, \ VEC_CAST(spec, letter_spec), spec.size()) +#define IMPLICIT1(t, spec, specs, l) make_Implicit_t(p.m_a, l, \ + down_cast(t), \ + VEC_CAST(spec, letter_spec), spec.size(), \ + VEC_CAST(specs, letter_spec), specs.size()) #define LETTER_SPEC1(a, l) make_LetterSpec_t(p.m_a, l, \ nullptr, name2char(a)) diff --git a/tests/implicit1.f90 b/tests/implicit1.f90 index 22ed1c3870..6d49cd47af 100644 --- a/tests/implicit1.f90 +++ b/tests/implicit1.f90 @@ -8,25 +8,30 @@ program implicit1 implicit none (type, external) implicit real (a-h,o-z) +implicit real (dp) (a-h,o-z) implicit real*8 (a-h,o-z) implicit double precision (a-h,o-z) implicit character (c,o-z) +implicit character (id) (a-z) implicit integer (i-n) implicit integer (i,j,k,l,m,n) implicit integer (i,j-l,m,n) +implicit integer (dp) (a-h,o-z) implicit integer*8 (i,j-l,m,n) IMPLICIT INTEGER (A, C) IMPLICIT INTEGER*4 (C, D-x) implicit logical (l, u-z) +implicit logical (dp) (a-h,o-z) implicit logical*4 (l, u-z) implicit complex (z) -implicit complex*4 (z) +implicit complex (dp) (a-h,o-z) IMPLICIT COMPLEX (C) +implicit complex*4 (z) IMPLICIT TYPE(BLOB) (A) IMPLICIT class(X) (A-b) From 8eda5a84b6cac9fa1b70b5ba83144642121fd1e3 Mon Sep 17 00:00:00 2001 From: Thirumalai-Shaktivel Date: Sat, 10 Jul 2021 21:05:36 +0530 Subject: [PATCH 2/3] Update tests --- tests/reference/ast-array7-b9de38f.json | 2 +- tests/reference/ast-array7-b9de38f.stdout | 2 +- tests/reference/ast-block1-ff0f95d.json | 2 +- tests/reference/ast-block1-ff0f95d.stdout | 2 +- tests/reference/ast-block_data1-d563f39.json | 2 +- tests/reference/ast-block_data1-d563f39.stdout | 2 +- tests/reference/ast-common1-abbc59b.json | 2 +- tests/reference/ast-common1-abbc59b.stdout | 2 +- tests/reference/ast-implicit1-e201262.json | 4 ++-- tests/reference/ast-implicit1-e201262.stdout | 2 +- tests/reference/ast_f90-implicit1-5bbb5d3.json | 4 ++-- tests/reference/ast_f90-implicit1-5bbb5d3.stdout | 7 ++++++- 12 files changed, 19 insertions(+), 14 deletions(-) diff --git a/tests/reference/ast-array7-b9de38f.json b/tests/reference/ast-array7-b9de38f.json index 246c8b9936..4927c1a51e 100644 --- a/tests/reference/ast-array7-b9de38f.json +++ b/tests/reference/ast-array7-b9de38f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-array7-b9de38f.stdout", - "stdout_hash": "91c0bb82311c8aeb810109a2aa5dcebc02b48907d8be47076ac15252", + "stdout_hash": "3432dfd3862f4109ab6913a2c646ae68c8d9e7f1ddefbb848e700c7e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-array7-b9de38f.stdout b/tests/reference/ast-array7-b9de38f.stdout index f2301d8b6f..f6bc5f3f4c 100644 --- a/tests/reference/ast-array7-b9de38f.stdout +++ b/tests/reference/ast-array7-b9de38f.stdout @@ -1 +1 @@ -(TranslationUnit [(Program array7 [] [(Implicit (AttrType TypeDoublePrecision [] ()) [(LetterSpec A H) (LetterSpec O Z)]) (Implicit (AttrType TypeInteger [] ()) [(LetterSpec I N)])] [(Declaration (AttrType TypeInteger [] ()) [(SimpleAttribute AttrParameter)] [(n [] [] 10 Equal ())]) (Declaration () [(AttrDimension [])] [(SJ [(0 N DimensionExpr)] [] () None ()) (DJ [(0 N DimensionExpr)] [] () None ())])] [] [])]) +(TranslationUnit [(Program array7 [] [(Implicit (AttrType TypeDoublePrecision [] ()) [] [(LetterSpec A H) (LetterSpec O Z)]) (Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec I N)])] [(Declaration (AttrType TypeInteger [] ()) [(SimpleAttribute AttrParameter)] [(n [] [] 10 Equal ())]) (Declaration () [(AttrDimension [])] [(SJ [(0 N DimensionExpr)] [] () None ()) (DJ [(0 N DimensionExpr)] [] () None ())])] [] [])]) diff --git a/tests/reference/ast-block1-ff0f95d.json b/tests/reference/ast-block1-ff0f95d.json index a794c856c6..fc8c64abd2 100644 --- a/tests/reference/ast-block1-ff0f95d.json +++ b/tests/reference/ast-block1-ff0f95d.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-block1-ff0f95d.stdout", - "stdout_hash": "37815f3591dceb42507a82b3327fbd201eb09d6b1d3fcc854516b0ec", + "stdout_hash": "900ba0a10aaaba890371554c430241973af4a0e10e0c817531fc9f8f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-block1-ff0f95d.stdout b/tests/reference/ast-block1-ff0f95d.stdout index 2423838690..3f1dbcfdb4 100644 --- a/tests/reference/ast-block1-ff0f95d.stdout +++ b/tests/reference/ast-block1-ff0f95d.stdout @@ -1 +1 @@ -(TranslationUnit [(Program block1 [] [(Implicit (AttrType TypeInteger [] ()) [(LetterSpec a z)])] [(Declaration (AttrType TypeInteger [] ()) [] [(B [] [] () None ())])] [(Block 0 () [(Use [] mod [(UseSymbol example ())] .true.)] [(Import [] ImportNone)] [] [(= 0 B 10)])] [])]) +(TranslationUnit [(Program block1 [] [(Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec a z)])] [(Declaration (AttrType TypeInteger [] ()) [] [(B [] [] () None ())])] [(Block 0 () [(Use [] mod [(UseSymbol example ())] .true.)] [(Import [] ImportNone)] [] [(= 0 B 10)])] [])]) diff --git a/tests/reference/ast-block_data1-d563f39.json b/tests/reference/ast-block_data1-d563f39.json index 9bc7925931..5037c29581 100644 --- a/tests/reference/ast-block_data1-d563f39.json +++ b/tests/reference/ast-block_data1-d563f39.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-block_data1-d563f39.stdout", - "stdout_hash": "8c8c39deb47d7d510d6ba8e494762b481122cf11c73093df76bedc43", + "stdout_hash": "4ffbf72adaa97e741a36dd2dfcf672bf96e7147f0aea4c77f5456c6b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-block_data1-d563f39.stdout b/tests/reference/ast-block_data1-d563f39.stdout index f44cf93dd2..ea10dc728d 100644 --- a/tests/reference/ast-block_data1-d563f39.stdout +++ b/tests/reference/ast-block_data1-d563f39.stdout @@ -1 +1 @@ -(TranslationUnit [(BlockData init [] [(Implicit (AttrType TypeInteger [] ()) [(LetterSpec a z)])] [(Declaration () [(SimpleAttribute AttrCommon)] [(range [] [] x0 Equal ()) (() [] [] x1 None ())]) (Declaration () [(AttrData [x0 x1] [1 10])] [])]) (Program block_data1 [] [(Implicit (AttrType TypeInteger [] ()) [(LetterSpec a z)])] [(Declaration () [(SimpleAttribute AttrCommon)] [(range [] [] x0 Equal ()) (() [] [] x1 None ())])] [(Print 0 () [(String "Printing Even number in the Range: ") x0 (String " to ") x1]) (DoLoop 0 () 0 i x0 x1 () [(If 0 () (/= (FuncCallOrArray mod [] [(() i ()) (() 2 ())] [] []) 0) [(Cycle 0 ())] []) (Write 0 [(()) (())] [] [i])])] [])]) +(TranslationUnit [(BlockData init [] [(Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec a z)])] [(Declaration () [(SimpleAttribute AttrCommon)] [(range [] [] x0 Equal ()) (() [] [] x1 None ())]) (Declaration () [(AttrData [x0 x1] [1 10])] [])]) (Program block_data1 [] [(Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec a z)])] [(Declaration () [(SimpleAttribute AttrCommon)] [(range [] [] x0 Equal ()) (() [] [] x1 None ())])] [(Print 0 () [(String "Printing Even number in the Range: ") x0 (String " to ") x1]) (DoLoop 0 () 0 i x0 x1 () [(If 0 () (/= (FuncCallOrArray mod [] [(() i ()) (() 2 ())] [] []) 0) [(Cycle 0 ())] []) (Write 0 [(()) (())] [] [i])])] [])]) diff --git a/tests/reference/ast-common1-abbc59b.json b/tests/reference/ast-common1-abbc59b.json index 78c300cc66..9b55f09658 100644 --- a/tests/reference/ast-common1-abbc59b.json +++ b/tests/reference/ast-common1-abbc59b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-common1-abbc59b.stdout", - "stdout_hash": "040edb6fe6c9e56a4f7f584887ed96fb061184ca160ccf2400af4a73", + "stdout_hash": "e8531516ab85a18edb814fae394e3d46afec76a2f53bf7a3fd62627d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-common1-abbc59b.stdout b/tests/reference/ast-common1-abbc59b.stdout index d48fbfd061..075e9687ad 100644 --- a/tests/reference/ast-common1-abbc59b.stdout +++ b/tests/reference/ast-common1-abbc59b.stdout @@ -1 +1 @@ -(TranslationUnit [(Program common1 [] [(Implicit (AttrType TypeReal [] ()) [(LetterSpec a z)])] [(Declaration (AttrType TypeReal [] ()) [] [(A [] [] () None ()) (B [] [] () None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(sample [] [] A Equal ()) (() [] [] B None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(c [] [] c Equal ()) (b [] [] d Equal ()) (() [] [] e None ()) (() [] [] f None ()) (c [] [] g Equal ()) (() [] [] h None ()) (() [] [] (FuncCallOrArray i [] [(() 5 ())] [] []) None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(() [] [] x None ()) (() [] [] y None ()) (() [] [] (FuncCallOrArray z [] [(() 10 ())] [] []) None ())])] [(= 0 A 10) (= 0 B 20) (SubroutineCall 0 pass [] [] []) (Stop 0 () ())] []) (Subroutine pass [] [] () [] [] [] [(Declaration (AttrType TypeReal [] ()) [] [(A [] [] () None ()) (B [] [] () None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(sample [] [] A Equal ()) (() [] [] B None ())])] [(Print 0 () [A B]) (Return 0 ())] [])]) +(TranslationUnit [(Program common1 [] [(Implicit (AttrType TypeReal [] ()) [] [(LetterSpec a z)])] [(Declaration (AttrType TypeReal [] ()) [] [(A [] [] () None ()) (B [] [] () None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(sample [] [] A Equal ()) (() [] [] B None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(c [] [] c Equal ()) (b [] [] d Equal ()) (() [] [] e None ()) (() [] [] f None ()) (c [] [] g Equal ()) (() [] [] h None ()) (() [] [] (FuncCallOrArray i [] [(() 5 ())] [] []) None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(() [] [] x None ()) (() [] [] y None ()) (() [] [] (FuncCallOrArray z [] [(() 10 ())] [] []) None ())])] [(= 0 A 10) (= 0 B 20) (SubroutineCall 0 pass [] [] []) (Stop 0 () ())] []) (Subroutine pass [] [] () [] [] [] [(Declaration (AttrType TypeReal [] ()) [] [(A [] [] () None ()) (B [] [] () None ())]) (Declaration () [(SimpleAttribute AttrCommon)] [(sample [] [] A Equal ()) (() [] [] B None ())])] [(Print 0 () [A B]) (Return 0 ())] [])]) diff --git a/tests/reference/ast-implicit1-e201262.json b/tests/reference/ast-implicit1-e201262.json index 2ff451ad9d..44c99c5783 100644 --- a/tests/reference/ast-implicit1-e201262.json +++ b/tests/reference/ast-implicit1-e201262.json @@ -2,11 +2,11 @@ "basename": "ast-implicit1-e201262", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/implicit1.f90", - "infile_hash": "90314e7e6719cd19c97dc27721c2e958df3a1da9fb724a403fab3dad", + "infile_hash": "9ef9d6d0d664b748ba5f86596980af98b2dccae961bf5ee4b4dbe5fe", "outfile": null, "outfile_hash": null, "stdout": "ast-implicit1-e201262.stdout", - "stdout_hash": "c83167ee57ab9eab6ff0122096ccf9f671dd01606601eab23ebecdb3", + "stdout_hash": "3d1253861280b57e8b6facadd8ea6493a6703c8326e986c914277d78", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-implicit1-e201262.stdout b/tests/reference/ast-implicit1-e201262.stdout index de5e55943c..4a61e731d9 100644 --- a/tests/reference/ast-implicit1-e201262.stdout +++ b/tests/reference/ast-implicit1-e201262.stdout @@ -1 +1 @@ -(TranslationUnit [(Program implicit1 [] [(ImplicitNone []) (ImplicitNone []) (ImplicitNone [(ImplicitNoneExternal 0)]) (ImplicitNone [(ImplicitNoneType)]) (ImplicitNone [(ImplicitNoneExternal 0) (ImplicitNoneType)]) (ImplicitNone [(ImplicitNoneType) (ImplicitNoneExternal 0)]) (Implicit (AttrType TypeReal [] ()) [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeReal [(() 8 Value)] ()) [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeDoublePrecision [] ()) [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeCharacter [] ()) [(LetterSpec () c) (LetterSpec o z)]) (Implicit (AttrType TypeInteger [] ()) [(LetterSpec i n)]) (Implicit (AttrType TypeInteger [] ()) [(LetterSpec () i) (LetterSpec () j) (LetterSpec () k) (LetterSpec () l) (LetterSpec () m) (LetterSpec () n)]) (Implicit (AttrType TypeInteger [] ()) [(LetterSpec () i) (LetterSpec j l) (LetterSpec () m) (LetterSpec () n)]) (Implicit (AttrType TypeInteger [(() 8 Value)] ()) [(LetterSpec () i) (LetterSpec j l) (LetterSpec () m) (LetterSpec () n)]) (Implicit (AttrType TypeInteger [] ()) [(LetterSpec () A) (LetterSpec () C)]) (Implicit (AttrType TypeInteger [(() 4 Value)] ()) [(LetterSpec () C) (LetterSpec D x)]) (Implicit (AttrType TypeLogical [] ()) [(LetterSpec () l) (LetterSpec u z)]) (Implicit (AttrType TypeLogical [(() 4 Value)] ()) [(LetterSpec () l) (LetterSpec u z)]) (Implicit (AttrType TypeComplex [] ()) [(LetterSpec () z)]) (Implicit (AttrType TypeComplex [(() 4 Value)] ()) [(LetterSpec () z)]) (Implicit (AttrType TypeComplex [] ()) [(LetterSpec () C)]) (Implicit (AttrType TypeType [] BLOB) [(LetterSpec () A)]) (Implicit (AttrType TypeClass [] X) [(LetterSpec A b)]) (Implicit (AttrType TypeProcedure [] Y) [(LetterSpec A b)])] [] [] [])]) +(TranslationUnit [(Program implicit1 [] [(ImplicitNone []) (ImplicitNone []) (ImplicitNone [(ImplicitNoneExternal 0)]) (ImplicitNone [(ImplicitNoneType)]) (ImplicitNone [(ImplicitNoneExternal 0) (ImplicitNoneType)]) (ImplicitNone [(ImplicitNoneType) (ImplicitNoneExternal 0)]) (Implicit (AttrType TypeReal [] ()) [] [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeReal [] ()) [(LetterSpec () dp)] [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeReal [(() 8 Value)] ()) [] [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeDoublePrecision [] ()) [] [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeCharacter [] ()) [] [(LetterSpec () c) (LetterSpec o z)]) (Implicit (AttrType TypeCharacter [] ()) [(LetterSpec () id)] [(LetterSpec a z)]) (Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec i n)]) (Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec () i) (LetterSpec () j) (LetterSpec () k) (LetterSpec () l) (LetterSpec () m) (LetterSpec () n)]) (Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec () i) (LetterSpec j l) (LetterSpec () m) (LetterSpec () n)]) (Implicit (AttrType TypeInteger [] ()) [(LetterSpec () dp)] [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeInteger [(() 8 Value)] ()) [] [(LetterSpec () i) (LetterSpec j l) (LetterSpec () m) (LetterSpec () n)]) (Implicit (AttrType TypeInteger [] ()) [] [(LetterSpec () A) (LetterSpec () C)]) (Implicit (AttrType TypeInteger [(() 4 Value)] ()) [] [(LetterSpec () C) (LetterSpec D x)]) (Implicit (AttrType TypeLogical [] ()) [] [(LetterSpec () l) (LetterSpec u z)]) (Implicit (AttrType TypeLogical [] ()) [(LetterSpec () dp)] [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeLogical [(() 4 Value)] ()) [] [(LetterSpec () l) (LetterSpec u z)]) (Implicit (AttrType TypeComplex [] ()) [] [(LetterSpec () z)]) (Implicit (AttrType TypeComplex [] ()) [(LetterSpec () dp)] [(LetterSpec a h) (LetterSpec o z)]) (Implicit (AttrType TypeComplex [] ()) [] [(LetterSpec () C)]) (Implicit (AttrType TypeComplex [(() 4 Value)] ()) [] [(LetterSpec () z)]) (Implicit (AttrType TypeType [] BLOB) [] [(LetterSpec () A)]) (Implicit (AttrType TypeClass [] X) [] [(LetterSpec A b)]) (Implicit (AttrType TypeProcedure [] Y) [] [(LetterSpec A b)])] [] [] [])]) diff --git a/tests/reference/ast_f90-implicit1-5bbb5d3.json b/tests/reference/ast_f90-implicit1-5bbb5d3.json index 18d05fa88b..e0be79ff64 100644 --- a/tests/reference/ast_f90-implicit1-5bbb5d3.json +++ b/tests/reference/ast_f90-implicit1-5bbb5d3.json @@ -2,11 +2,11 @@ "basename": "ast_f90-implicit1-5bbb5d3", "cmd": "lfortran --show-ast-f90 --no-color {infile}", "infile": "tests/implicit1.f90", - "infile_hash": "90314e7e6719cd19c97dc27721c2e958df3a1da9fb724a403fab3dad", + "infile_hash": "9ef9d6d0d664b748ba5f86596980af98b2dccae961bf5ee4b4dbe5fe", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-implicit1-5bbb5d3.stdout", - "stdout_hash": "970ea08a4f8b14b03e52d6560e06cbe0055f8c3be680421a576842d8", + "stdout_hash": "3abeb8e837666ed0c4fd874e98706490169ff08ff66fc78390c7b18b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast_f90-implicit1-5bbb5d3.stdout b/tests/reference/ast_f90-implicit1-5bbb5d3.stdout index 012779db97..ced74f4f80 100644 --- a/tests/reference/ast_f90-implicit1-5bbb5d3.stdout +++ b/tests/reference/ast_f90-implicit1-5bbb5d3.stdout @@ -6,20 +6,25 @@ implicit none (type) implicit none (external, type) implicit none (type, external) implicit real (a-h,o-z) +implicit real (dp) (a-h,o-z) implicit real(8) (a-h,o-z) implicit double precision (a-h,o-z) implicit character (c,o-z) +implicit character (id) (a-z) implicit integer (i-n) implicit integer (i,j,k,l,m,n) implicit integer (i,j-l,m,n) +implicit integer (dp) (a-h,o-z) implicit integer(8) (i,j-l,m,n) implicit integer (A,C) implicit integer(4) (C,D-x) implicit logical (l,u-z) +implicit logical (dp) (a-h,o-z) implicit logical(4) (l,u-z) implicit complex (z) -implicit complex(4) (z) +implicit complex (dp) (a-h,o-z) implicit complex (C) +implicit complex(4) (z) implicit type(BLOB) (A) implicit class(X) (A-b) implicit procedure(Y) (A-b) From a2a818a9f29c8f2d3055af16a225827159808d43 Mon Sep 17 00:00:00 2001 From: Thirumalai-Shaktivel Date: Sun, 11 Jul 2021 10:49:41 +0530 Subject: [PATCH 3/3] Rename spec to kind --- grammar/AST.asdl | 2 +- src/lfortran/ast_to_src.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/grammar/AST.asdl b/grammar/AST.asdl index 1f4c9064d6..4c87866c02 100644 --- a/grammar/AST.asdl +++ b/grammar/AST.asdl @@ -90,7 +90,7 @@ import_modifier implicit_statement = ImplicitNone(implicit_none_spec* specs) - | Implicit(decl_attribute type, letter_spec* spec, letter_spec* specs) + | Implicit(decl_attribute type, letter_spec* kind, letter_spec* specs) implicit_none_spec = ImplicitNoneExternal(int dummy) diff --git a/src/lfortran/ast_to_src.cpp b/src/lfortran/ast_to_src.cpp index 1fd5bc7c97..8c919d05cf 100644 --- a/src/lfortran/ast_to_src.cpp +++ b/src/lfortran/ast_to_src.cpp @@ -889,10 +889,10 @@ class ASTToSRCVisitor : public BaseVisitor r += " "; visit_decl_attribute(*x.m_type); r += s; - if (x.n_spec > 0) { + if (x.n_kind > 0) { r += " ("; - for (size_t i=0; i