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

[WIP] Documentation for all the standard rules #73

Merged
merged 10 commits into from
Aug 31, 2020
Merged

Conversation

pranaygp
Copy link
Member

No description provided.

@todo
Copy link

todo bot commented Aug 29, 2020

This value cannot be used by browse and is only understood by the runtime. Provide a better value }

* @return { [Rule] TODO: This value cannot be used by browse and is only understood by the runtime. Provide a better value }
* @throws { If a rule already exists with the same name }
*/
rule: (scope) => (opts) => (name, body) => {
let existingRule;


This comment was generated by todo based on a TODO comment in 39e47a3 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 29, 2020

remove this check when we have static types

// TODO: remove this check when we have static types
if (typeof ms !== "number") throw new Error("Argument is a not a number");
return new Promise((r) => setTimeout(r, ms)).then(() => ms);
},
/**
* @desc { Print values to stdout }


This comment was generated by todo based on a TODO comment in 39e47a3 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 29, 2020

) }

* @desc { Import a module. Read the [Browse Modules](#) guide for more info (TODO) }
*/
import: (_) => (_) => async (...mods) => {
// evalRule should catch imports and handle them specially
throw new Error("Unexpected browse error");
},


This comment was generated by todo based on a TODO comment in 39e47a3 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

if body has `expects`, inject those from _ruleEvalScope

// TODO: if body has `expects`, inject those from _ruleEvalScope
evalRuleSet(body, {
rules: {
// TODO: bind should only be accessible at the top level
/**
* @rule { bind }


This comment was generated by todo based on a TODO comment in 447210d in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

Will break if multiple rules have the same name in different scopes

// TODO: Will break if multiple rules have the same name in different scopes
const rules = Object.keys(docTree[scope].rules).map((rule) =>
link(`Rule: ${rule}`, `#${rule}`)
);
const configVars = Object.keys(


This comment was generated by todo based on a TODO comment in 447210d in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

bind should only be accessible at the top level

// TODO: bind should only be accessible at the top level
/**
* @rule { bind }
* @scope { rule }
* @desc {
* **Only used within a {@link rule\} body**


This comment was generated by todo based on a TODO comment in 447210d in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

if body has `expects`, inject those from _ruleEvalScope

// TODO: if body has `expects`, inject those from _ruleEvalScope
evalRuleSet(body, {
rules: {
// TODO: bind should only be accessible at the top level
/**
* @rule { bind }


This comment was generated by todo based on a TODO comment in aa53349 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

if body has `expects`, inject those from _ruleEvalScope

// TODO: if body has `expects`, inject those from _ruleEvalScope
evalRuleSet(body, {
rules: {
// TODO: bind should only be accessible at the top level
/**
* @rule { bind }


This comment was generated by todo based on a TODO comment in e13c34f in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

Should return the value of the last evaluated statement, or the number of iterations?)

browse/packages/docs/out.md

Lines 256 to 261 in e13c34f

- Returns: \<**nil**\> nil (TODO: Should return the value of the last evaluated statement, or the number of iterations?)
Execute the `body` while the `test` expressions in the `interator` do not fail
> The contents of the iterator is split into multiple parts:
>


This comment was generated by todo based on a TODO comment in e13c34f in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

if body has `expects`, inject those from _ruleEvalScope

// TODO: if body has `expects`, inject those from _ruleEvalScope
evalRuleSet(body, {
rules: {
// TODO: bind should only be accessible at the top level
/**
* @rule { bind }


This comment was generated by todo based on a TODO comment in 0d87ce0 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 30, 2020

if body has `expects`, inject those from _ruleEvalScope

// TODO: if body has `expects`, inject those from _ruleEvalScope
evalRuleSet(body, {
rules: {
// TODO: bind should only be accessible at the top level
/**
* @rule { bind }


This comment was generated by todo based on a TODO comment in 60bb6f1 in #73. cc @windsorio.

* origin/master:
  undo the var printing thing
  Excluding current cell from computation
  no need for console log
  fixing readme
  fixing typo
  Adding conway's game of life + autoprint of vars if rule cannot be resolved for debugging
@todo
Copy link

todo bot commented Aug 31, 2020

if body has `expects`, inject those from _ruleEvalScope

// TODO: if body has `expects`, inject those from _ruleEvalScope
evalRuleSet(body, {
rules: {
// TODO: bind should only be accessible at the top level
/**
* @rule { bind }


This comment was generated by todo based on a TODO comment in 6d0c850 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 31, 2020

Only pull from comments that start with *

* TODO: Only pull from comments that start with *
*/
const pullAllTags = (comments) =>
comments.map((comment) => pullTags(comment.value)).reduce(safeMergeObjs, {});
const parseParams = (paramString) => {


This comment was generated by todo based on a TODO comment in 6d0c850 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 31, 2020

Return just the comments not within a tag

//TODO: Return just the comments not within a tag
rtn.help = rule.leadingComments
.map((node) => cleanComment(node.value))
.join("\n");
} else {
//else we just extract data from @help tags


This comment was generated by todo based on a TODO comment in 6d0c850 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 31, 2020

Return just the comments not within a tag

//TODO: Return just the comments not within a tag
rtn.help = rule.leadingComments
.map((node) => cleanComment(node.value))
.join("\n");
} else {
//else we just extract data from @help tags


This comment was generated by todo based on a TODO comment in 6d0c850 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 31, 2020

Return just the comments not within a tag

//TODO: Return just the comments not within a tag
rtn[ruleName].help = rule.leadingComments
.map((node) => cleanComment(node.value))
.join("\n");
} else {
//else we just extract data from @help tags


This comment was generated by todo based on a TODO comment in 6d0c850 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 31, 2020

Return just the comments not within a tag

//TODO: Return just the comments not within a tag
rtn[ruleName].help = rule.leadingComments
.map((node) => cleanComment(node.value))
.join("\n");
} else {
//else we just extract data from @help tags


This comment was generated by todo based on a TODO comment in 6d0c850 in #73. cc @windsorio.

@todo
Copy link

todo bot commented Aug 31, 2020

We should try to grab the name, type, and init value

//TODO: We should try to grab the name, type, and init value
const propertyName = property.key.name;
const tags = pullAllTags(property.leadingComments || []);
if (tags["@config"] === undefined) {


This comment was generated by todo based on a TODO comment in 6d0c850 in #73. cc @windsorio.

@pranaygp
Copy link
Member Author

The docs generator for .browse files isn't done but, I'm merging this in now because it's submission day.

After everything is tested, I'll finish the doc generator #78

@pranaygp pranaygp closed this Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant