Permalink
Browse files

Convert JS.Class classes to normal functions.

  • Loading branch information...
jcoglan committed Apr 26, 2012
1 parent 2276b65 commit 66243578a7ab0e443c441c37618d767008b82ca5
Showing with 18 additions and 18 deletions.
  1. +13 −13 source/canopy/builder.js
  2. +5 −5 source/canopy/compiler.js
View
@@ -1,16 +1,16 @@
-Canopy.Builder = new JS.Class({
- initialize: function(parent) {
- if (parent) {
- this._parent = parent;
- this._indentLevel = parent._indentLevel;
- } else {
- this._buffer = '';
- this._indentLevel = 0;
- }
- this._methodSeparator = '';
- this._varIndex = {};
- },
-
+Canopy.Builder = function(parent) {
+ if (parent) {
+ this._parent = parent;
+ this._indentLevel = parent._indentLevel;
+ } else {
+ this._buffer = '';
+ this._indentLevel = 0;
+ }
+ this._methodSeparator = '';
+ this._varIndex = {};
+};
+
+Canopy.extend(Canopy.Builder.prototype, {
serialize: function() {
return this._buffer;
},
View
@@ -1,8 +1,8 @@
-Canopy.Compiler = new JS.Class({
- initialize: function(grammarText) {
- this._grammarText = grammarText;
- },
-
+Canopy.Compiler = function(grammarText) {
+ this._grammarText = grammarText;
+};
+
+Canopy.extend(Canopy.Compiler.prototype, {
parseTree: function() {
return this._tree = this._tree ||
Canopy.MetaGrammarParser.parse(this._grammarText);

3 comments on commit 6624357

gf3 replied Apr 27, 2012

Woo!

Owner

jcoglan replied Apr 27, 2012

@gf3 Are you using Canopy?

gf3 replied Apr 27, 2012

@jcoglan Not currently, but this was one of the reasons I didn't use it when I was originally looking for a parser generator. I look forward to giving it a shot though.

Please sign in to comment.