-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
2,154 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module Darklang = | ||
module KeywordDescription = | ||
type KeywordDescription = { name: String; description: String } | ||
|
||
let keywords () : List<KeywordDescription> = | ||
[ KeywordDescription | ||
{ name = "module" | ||
description = | ||
"Used to associate a name with a group of related types, values, and functions, to logically separate it from other code." } | ||
KeywordDescription | ||
{ name = "const" | ||
description = "Keyword to specify a constant literal." } | ||
KeywordDescription | ||
{ name = "let" | ||
description = | ||
"Lets creates a name with an immutable value, and a scope in which that is defined." } | ||
KeywordDescription | ||
{ name = "type" | ||
description = "Used to declare an alias, record, or an enumeration type." } | ||
KeywordDescription | ||
{ name = "of" | ||
description = "of keyword description TODO" } | ||
KeywordDescription | ||
{ name = "with" | ||
description = "with keyword description TODO" } | ||
KeywordDescription | ||
{ name = "if" | ||
description = "Used in conditional expressions." } | ||
KeywordDescription | ||
{ name = "then" | ||
description = "then keyword description TODO" } | ||
KeywordDescription | ||
{ name = "else" | ||
description = "else keyword description TODO" } | ||
KeywordDescription | ||
{ name = "fun" | ||
description = "fun keyword description TODO" } | ||
KeywordDescription | ||
{ name = "match" | ||
description = "match keyword description TODO" } | ||
KeywordDescription | ||
{ name = "when" | ||
description = "when keyword description TODO" } | ||
KeywordDescription | ||
{ name = "List" | ||
description = "List keyword description TODO" } | ||
KeywordDescription | ||
{ name = "Dict" | ||
description = "Dict keyword description TODO" } | ||
KeywordDescription | ||
{ name = "DB" | ||
description = "Db keyword description TODO" } ] | ||
|
||
let getKeywordDescription (name: String) : Stdlib.Option.Option<String> = | ||
(keywords ()) | ||
|> Stdlib.List.findFirst (fun k -> k.name == name) | ||
|> Stdlib.Option.map (fun k -> k.description) |
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
Oops, something went wrong.