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

Generalized the library by removing Fortran-specific references resolving issue #554 #2818

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/libasr/ASR.asdl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Abstract Semantic Representation (ASR) definition

-- Documenations are available at:
-- https://github.com/lfortran/lfortran/tree/main/doc/src/asr/asr.md
-- Documentation is available at:
-- https://github.com/lcompilers/lpython/tree/main/doc/src/asr/asr.md

module ASR {

Expand Down Expand Up @@ -87,7 +87,7 @@ expr
| IntrinsicElementalFunction(int intrinsic_id, expr* args, int overload_id, ttype? type, expr? value)
| IntrinsicArrayFunction(int arr_intrinsic_id, expr* args, int overload_id, ttype? type, expr? value)
| IntrinsicImpureFunction(int impure_intrinsic_id, expr* args, int overload_id, ttype? type, expr? value)
| TypeInquiry(int inquiry_id, ttype arg_type, expr? arg, ttype type, expr value)
| TypeInquiry(int inquiry_id, ttype arg_type, expr? arg, ttype type, expr? value)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is not correct actually. expr? means a field which is optional and can be set to nullptr. Here, expr? value refers to compile-time value, which can be absent sometimes.

| StructConstructor(symbol dt_sym, call_arg* args, ttype type, expr? value)
| EnumTypeConstructor(symbol dt_sym, expr* args, ttype type, expr? value)
| UnionTypeConstructor(symbol dt_sym, expr* args, ttype type, expr? value)
Expand Down Expand Up @@ -125,7 +125,7 @@ expr
| SetConstant(expr* elements, ttype type)
| SetLen(expr arg, ttype type, expr? value)
| TupleConstant(expr* elements, ttype type)
| TupleLen(expr arg, ttype type, expr value)
| TupleLen(expr arg, ttype type, expr? value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

| TupleCompare(expr left, cmpop op, expr right, ttype type, expr? value)
| TupleConcat(expr left, expr right, ttype type, expr? value)
| TupleContains(expr left, expr right, ttype type, expr? value)
Expand Down Expand Up @@ -216,12 +216,13 @@ ttype
| FunctionType(ttype* arg_types, ttype? return_var_type, abi abi, deftype deftype, string? bindc_name, bool elemental, bool pure, bool module, bool inline, bool static, symbol* restrictions, bool is_restriction)

cast_kind = RealToInteger | IntegerToReal | LogicalToReal | RealToReal | IntegerToInteger | RealToComplex | IntegerToComplex | IntegerToLogical | RealToLogical | CharacterToLogical | CharacterToInteger | CharacterToList | ComplexToLogical | ComplexToComplex | ComplexToReal | ComplexToInteger | LogicalToInteger | RealToCharacter | IntegerToCharacter | LogicalToCharacter | UnsignedIntegerToInteger | UnsignedIntegerToUnsignedInteger | UnsignedIntegerToReal | UnsignedIntegerToLogical | IntegerToUnsignedInteger | RealToUnsignedInteger | CPtrToUnsignedInteger | UnsignedIntegerToCPtr | IntegerToSymbolicExpression | ListToArray | DerivedToBase

storage_type = Default | Save | Parameter
access = Public | Private
intent = Local | In | Out | InOut | ReturnVar | Unspecified
deftype = Implementation | Interface
presence = Required | Optional
abi = Source | LFortranModule | GFortranModule | BindC | BindPython | BindJS | Interactive | Intrinsic
abi = Source | Module | BindC | BindPython | BindJS | Interactive | Intrinsic | External
dimension = (expr? start, expr? length)
alloc_arg = (expr a, dimension* dims, expr? len_expr, ttype? type)
attribute = Attribute(identifier name, attribute_arg *args)
Expand All @@ -241,6 +242,7 @@ cmpop = Eq | NotEq | Lt | LtE | Gt | GtE
integerboz = Binary | Hex | Octal
arraybound = LBound | UBound
arraystorage = RowMajor | ColMajor
string_format_kind = FormatFortran | FormatC | FormatPythonPercent | FormatPythonFString | FormatPythonFormat
string_format_kind = FormatCustom1 | FormatC | FormatPythonPercent | FormatPythonFString | FormatPythonFormat


}
}
Loading