-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements the extends keyword for types defined in the dsl.
Fixes issue with test for extends. Working to get the tests to pass. The nools parser test for defines uses a deep equal to a known structure. There is a new property in the define parse output, extend: <typename> , this is null unless there is an actual base class. Adding null, trivial change for this. Implements the extends keyword for types defined in the dsl.
- Loading branch information
1 parent
ca15994
commit b8a61e5
Showing
7 changed files
with
135 additions
and
16 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
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
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
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
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
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
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,46 @@ | ||
| ||
define Person { | ||
constructor: function(name){ | ||
this.name = name; | ||
} | ||
} | ||
|
||
define Student extends Person { | ||
constructor: function(name, school) { | ||
Person.call(this, name); | ||
this.school = school; | ||
} | ||
} | ||
|
||
define LongTermStudent extends Student { | ||
constructor: function(name, school, years) { | ||
Student.call(this, name, school); | ||
this.years = years; | ||
} | ||
} | ||
|
||
|
||
rule PersonTest { | ||
when { | ||
p: Person; | ||
} | ||
then { | ||
} | ||
} | ||
|
||
rule StudentTest { | ||
when { | ||
s: Student; | ||
} | ||
then { | ||
} | ||
} | ||
|
||
|
||
rule LongTermStudentTest { | ||
when { | ||
s: LongTermStudent; | ||
} | ||
then { | ||
} | ||
} |