Skip to content

Commit

Permalink
v0.4.0 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed Feb 26, 2015
1 parent b43d64f commit 86627a4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
15 changes: 15 additions & 0 deletions History.html
Expand Up @@ -178,6 +178,21 @@



<h1>0.4.0</h1>
<ul>
<li>Fix for issue <a href="https://github.com/C2FO/nools/issues/122">#122</a> referencing defined class within another defined class<ul>
<li>Also fixes accessing scoped functions within a defined class.</li>
</ul>
</li>
<li>Fix for issue <a href="https://github.com/C2FO/nools/issues/119">#119</a> window was removed from the nools.js file now it is called in the current scope of <code>this</code>.</li>
<li>Allow session.halt even for <code>match()</code> <a href="https://github.com/C2FO/nools/pull/143">#143</a> - <a href="https://github.com/raymondfeng">@raymondfeng</a><ul>
<li>Now if you call <code>halt()</code> even if you did not call <code>matchUntilHalt()</code></li>
</ul>
</li>
<li>Now you can use a function as a constraint (Only applies to rules defined programatically) <a href="https://github.com/C2FO/nools/pull/142">#142</a> - <a href="https://github.com/raymondfeng">@raymondfeng</a></li>
<li>You can now define types using scope <a href="https://github.com/C2FO/nools/pull/142">#142</a> - <a href="https://github.com/raymondfeng">@raymondfeng</a></li>
<li>Fix for issue, is the dsl you do not have to escape <code>\</code> characters <a href="https://github.com/C2FO/nools/issues/123">#123</a></li>
</ul>
<h1>0.3.0</h1>
<ul>
<li>Added new <code>===</code> and <code>!==</code> operators <a href="https://github.com/C2FO/nools/issues/110">#110</a></li>
Expand Down
1 change: 0 additions & 1 deletion examples/browser/conways_2d.html
Expand Up @@ -36,7 +36,6 @@ <h1>Conways Game Of Life 2D</h1>
<script type="text/javascript" src="src/common.js"></script>
<script type="text/javascript" src="src/patterns.js"></script>
<script type="text/javascript" src="src/cell.js"></script>
<script type="text/javascript" src="rules/conways.js"></script>
<script type="text/javascript">

(function () {
Expand Down
14 changes: 7 additions & 7 deletions index.html
Expand Up @@ -263,7 +263,7 @@ <h3>Programmatically</h3>
var flow = nools.flow(&quot;Hello World&quot;, function (flow) {

//find any message that start with hello
flow.rule(&quot;Hello&quot;, [Message, &quot;m&quot;, &quot;m.text =~ /^hello(\\s*world)?$/&quot;], function (facts) {
flow.rule(&quot;Hello&quot;, [Message, &quot;m&quot;, &quot;m.text =~ /^hello\\sworld$/&quot;], function (facts) {
facts.m.text = facts.m.text + &quot; goodbye&quot;;
this.modify(facts.m);
});
Expand All @@ -277,7 +277,7 @@ <h3>Programmatically</h3>
<ul>
<li>Hello<ul>
<li>Requires a Message</li>
<li>The messages&#39;s <code>text</code> must match the regular expression <code>/^hello(\\s*world)?$/</code></li>
<li>The messages&#39;s <code>text</code> must match the regular expression <code>/^hello\\sworld$/</code></li>
<li>When matched the message&#39;s <code>text</code> is modified and then we let the engine know that we modified the message.</li>
</ul>
</li>
Expand Down Expand Up @@ -395,7 +395,8 @@ <h3><code>nools.compile</code></h3>
scope: {
//the logger you want your flow to use.
logger: logger
}
},
name: &#39;person name is bob&#39;
});</code></pre>
<p><a name="session"></a></p>
<h2>Working with a session</h2>
Expand Down Expand Up @@ -985,7 +986,7 @@ <h3>Scope</h3>

rule Hello {
when {
m : Message matches(m.text, /^hello(\\s*world)?$/);
m : Message matches(m.text, /^hello\s*world)?$/);
}
then {
modify(m, function(){
Expand All @@ -1004,7 +1005,7 @@ <h3>Scope</h3>
<p>Or you can pass in a custom function using the scope option in compile.</p>
<pre class='prettyprint linenums lang-js'><code>rule Hello {
when {
m : Message doesMatch(m.text, /^hello(\\s*world)?$/);
m : Message doesMatch(m.text, /^hello\sworld$/);
}
then {
modify(m, function(){
Expand Down Expand Up @@ -1415,7 +1416,7 @@ <h3>Example 1.</h3>

rule Hello {
when {
m : Message m.text =~ /^hello(\\s*world)?$/
m : Message m.text =~ /^hello\sworld$/
}
then {
modify(m, function(){
Expand Down Expand Up @@ -1443,7 +1444,6 @@ <h3>Example 1.</h3>
session = flow.getSession();
//assert your different messages
session.assert(new Message(&quot;goodbye&quot;));
session.assert(new Message(&quot;hello&quot;));
session.assert(new Message(&quot;hello world&quot;));
session.match();
}
Expand Down
20 changes: 10 additions & 10 deletions nools.js

Large diffs are not rendered by default.

0 comments on commit 86627a4

Please sign in to comment.