Skip to content

Commit

Permalink
Merge branch 'docfix' into 'master'
Browse files Browse the repository at this point in the history
Improved LFortran documentation

See merge request lfortran/lfortran!227
  • Loading branch information
certik committed Aug 14, 2019
2 parents dbcf0da + c042bfe commit e82233d
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 12 deletions.
1 change: 1 addition & 0 deletions doc/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ nav:
- Home: index.md
- installation.md
- language.md
- progress.md
- Developer's Guide:
- design.md
- developer_tutorial.md
Expand Down
8 changes: 6 additions & 2 deletions doc/nb/AST and ASR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"```fortran\n",
"integer function f(a, b) result(r)\n",
"integer, intent(in) :: a, b\n",
"r = a + b\n",
"integer :: c, d\n",
"c = a + b - d\n",
"r = c * a\n",
"end function\n",
"```\n",
"and look at how the AST and ASR looks like.\n",
Expand All @@ -29,7 +31,9 @@
"src = \"\"\"\\\n",
"integer function f(a, b) result(r)\n",
"integer, intent(in) :: a, b\n",
"r = a + b\n",
"integer :: c, d\n",
"c = a + b - d\n",
"r = c * a\n",
"end function\n",
"\"\"\"\n",
"ast = src_to_ast(src, translation_unit=False)\n",
Expand Down
18 changes: 9 additions & 9 deletions doc/src/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ The ASR is designed to have the following features:
construction, the ASR classes always contain valid Fortran code and the rest
of LFortran can depend on it.

Note: Information that is lost when parsing source to AST: whitespace,
multiline/single line if statement distinction, case sensitivity of keywords.
Information that is lost when going from AST to ASR: detailed syntax how
variables were defined and the order of type attributes (whether array
dimension is using the `dimension` attribute, or parentheses at the variable;
or how many variables there are per declaration line or their order), as ASR
only represents the aggregated type information in the symbol table.

Note: ASR is the simplest way to generate Fortran code, as one does not
## Notes:

Information that is lost when parsing source to AST:
whitespace, multiline/single line if statement distinction, case sensitivity of keywords.

Information that is lost when going from AST to ASR:
detailed syntax how variables were defined and the order of type attributes (whether array dimension is using the `dimension` attribute, or parentheses at the variable; or how many variables there are per declaration line or their order), as ASR only represents the aggregated type information in the symbol table.

ASR is the simplest way to generate Fortran code, as one does not
have to worry about the detailed syntax (as in AST) about how and where
things are declared. One specifies the symbol table for a module, then for
each symbol (functions, global variables, types, ...) one specifies the local
Expand Down
2 changes: 1 addition & 1 deletion doc/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Try online using Binder:
## Feature Highlights

LFortran is in development, there are features that work today, and there are
features that are being implemented.
features that are being implemented. You can also check out the [Development Status](progress.md) section for more information on features being supported and being worked on.

### Works today

Expand Down
82 changes: 82 additions & 0 deletions doc/src/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# LFortran Development Status


## Development

**LFortran** is currently under development and some of the features of Fortran might not be supported currently. The information regarding which functions are currently supported and which one's are still being worked on will be available in this section. You can submit any new issue you find while using LFortran to our [issue tracker](https://gitlab.com/lfortran/lfortran/issues). You can also check out any of the issues mentioned in the sections below and provide suggestions and ideas to help us get the feature implemented.

## Fortran Standards Supported

LFortran currently supports a subset of the latest Fortran standard Fortran 2018. This document describes details about which features are supported and which are not.

### Related Issues:

- [#120](https://gitlab.com/lfortran/lfortran/issues/120)

## Features Supported

LFortran is currently in development and you might find some unsupported features while using it. We are working on fixing the issues and improving and expanding LFortran. You can also help out by reporting any new bug you find or you can check out any of the issues mentioned in the section and help us implement the feature faster.

### Currently Supported:

- AST Genreation
- ASR Generation for most nodes
- Fortran Modules
- Functions
- Subroutines
- Basic data types like int, float, character
- Binary Operations
- Conditional and iterative statements
- Printing

### Not Supported/Currently in Development

- Strings and Arrays
- Nested Function Definitions
- Complex Numbers
- Optional Arguments
- ASR not created for a few features supported by LFortran
- Conditional and iterative statements
- Function Calls
- Arithmatic assignment(like a = 10)
- Assignments with binary operations including any number
- Logical Variables
- Print Statements
- Intrinsic Fortran Functions like abs, sin, cos etc.

### Related Issues

- [#114 Strings](https://gitlab.com/lfortran/lfortran/issues/114)
- [#121 ASR](https://gitlab.com/lfortran/lfortran/issues/121)
- [#122 Nested Function Definitions](https://gitlab.com/lfortran/lfortran/issues/122)
- [#125 Complex Numbers](https://gitlab.com/lfortran/lfortran/issues/125)
- [#126 Optional Arguments](https://gitlab.com/lfortran/lfortran/issues/126)

## Intrinsic Functions

LFortran does not support some of the standard intrinsic functions for the Fortran standard. Work is being done on having support for these functions. The testing for the functions is still being done. The list will be updated with the rest of the functions soon.

### Currently Supported:

- log

### Not Suported/Currently in Development:

- abs
- sqrt
- sin
- cos
- tan
- asin
- acos
- atan
- exp
- int
- real
- nint
- floor
- fraction
- real
- max
- min
- mod

0 comments on commit e82233d

Please sign in to comment.