Skip to content

Fix docs #46

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function buildDeps()
Pkg.add("DataStructures")
Pkg.add("MacroTools")
Pkg.add("ImmutableList")
Pkg.add("Setfield")
@info("Build all dependencies succesfull")
end

Expand Down
4 changes: 4 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
push!(LOAD_PATH,"../src/")
using Documenter, MetaModelica

makedocs(sitename="My Documentation")
21 changes: 21 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MetaModelica.jl Documentation

```@meta
CurrentModule = MetaModelica
```

## Outline
```@contents
Pages = [
"man/runtime.md",
"man/matchin.md",
"man/list.md",
"man/semantics.md",
]
Depth = 1
```

## Index

```@index
```
15 changes: 15 additions & 0 deletions docs/src/man/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```@meta
CurrentModule = MetaModelica
```

```@contents
```

## List operations
```@docs
do_threaded_for
<|
shouldFail
sourceInfo
_cons
```
6 changes: 6 additions & 0 deletions docs/src/man/matchin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Patternmatching
```@docs
@match
@matchcontinue
MatchFailure
```
134 changes: 134 additions & 0 deletions docs/src/man/runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
## Runtime Functions provided by MetaModelica.jl
```@docs
anyString
arrayAppend
arrayCopy
arrayCreate
arrayEmpty
arrayGet
arrayLength
arrayList
arrayUpdate
boolNot
boolAnd
boolEq
boolOr
boolString
clock
cons
debug_print
equality
fail
getGlobalRoot
intAbs
intAdd
intBitLShift
intBitNot
intBitOr
intBitRShift
intBitXor
intDiv
intEq
intGe
intGt
intLe
intLt
intMax
intMin
intMod
intMul
intMul
intNe
intNeg
intReal
intString
intStringChar
intSub
isNone
isPresent
isSome
listAppend
listArray
listDelete
listEmpty
listGet
listHead
listLength
listMember
listRest
listReverse
listReverseInPlace
listStringCharString
printAny
realAbs
realAdd
realDiv
realEq
realGe
realGt
realInt
realLe
realLt
realMax
realMin
realMod
realMul
realNe
realNeg
realNeg
realPow
realString
realSub
referenceDebugString
referenceEq
referencePointerString
setGlobalRoot
setStackOverflowSignal
stringAppend
stringAppendList
stringCharInt
stringCharListString
stringCompare
stringDelimitList
stringEmpty
stringEqual
stringEq
stringGet
stringGetStringChar
stringHash
stringHashDjb2
stringHashDjb2Mod
stringHashSdbm
stringInt
stringLength
stringListStringChar
stringReal
stringUpdateStringChar
substring
tick
valueCompare
valueConstructor
valueEq
valueHashMod
valueSlots
_listAppend
getInstanceName
StringFunction
```

## Patternmatching
```@docs
match
matchcontinue
MatchFailure
```
## Extended Semantics
```
Uniontype
Record
UniontypeDecl
ExtendedFunction
ExtendedAnonFunction
assign
shouldFail
```
14 changes: 14 additions & 0 deletions docs/src/man/semantics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Semantic extensions

This package provides various extensions to the semantics of the Julia language.
The extensions provided by this package are listed below.

```@docs
@Uniontype
@Record
@UniontypeDecl
@ExtendedFunction
@ExtendedAnonFunction
@assign
@shouldFail
```
1 change: 0 additions & 1 deletion src/metaModelicaTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ TODO:
=#

abstract type MetaModelicaException <: Exception end

export ModelicaInteger, ModelicaReal, MetaModelicaException

end
6 changes: 3 additions & 3 deletions src/metaRuntime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ function substring(str::String, start #=start index, first character is 1 =#::Mo
out
end

""" O(1) ? """
""" O(1) """
function arrayLength(arr::Array{T})::ModelicaInteger where {T}
length(arr)
end
Expand All @@ -511,7 +511,7 @@ function arrayCreate(size::ModelicaInteger, initialValue::A)::Array{A} where {A}
fill(initialValue, size)
end

""" Better """
""" Creates an array out of a List """
function arrayList(arr::Array{T})::List{T} where {T}
local lst::List{T} = nil
for i in length(arr):-1:1
Expand Down Expand Up @@ -649,7 +649,7 @@ function valueEq(a1::A, a2::B)::Bool where {A, B}
b
end

""" a1 > a2? """
""" a1 > a2 """
function valueCompare(a1::A, a2::A)::ModelicaInteger where {A}
local i::ModelicaInteger =
if valueConstructor(a1) < valueConstructor(a2)
Expand Down