Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

play around with github's syntax highlighting

  • Loading branch information...
commit de655263fc087f397f81113d7f9cb4829a195fec 1 parent 9c83d21
@Floby authored
Showing with 22 additions and 20 deletions.
  1. +22 −20 README.markdown
View
42 README.markdown
@@ -25,26 +25,28 @@ functions _'handlers'_.
This can be achieved through configuration of the basic parser or
through inheritance.
- var Parser = require('parser');
- var util = require('util');
- var MyTokenizer = require('./MyTokenizer');
-
- function MyParser() {
- // MyTokenizer is the tokenizer we configured
- // but it's not the subject of this module
- Parser.apply(this, new MyTokenizer());
-
- // override the default behaviour
- this.defaultHandler(this.default);
-
- // specify the function that will be called on the first token
- this.initialHander(this.initial);
- }
- util.inherits(MyParser, Parser);
-
- /**
- * Of course you will have to define these functions somewhere
- */
+``` javascript
+var Parser = require('parser');
+var util = require('util');
+var MyTokenizer = require('./MyTokenizer');
+
+function MyParser() {
+ // MyTokenizer is the tokenizer we configured
+ // but it's not the subject of this module
+ Parser.apply(this, new MyTokenizer());
+
+ // override the default behaviour
+ this.defaultHandler(this.default);
+
+ // specify the function that will be called on the first token
+ this.initialHander(this.initial);
+}
+util.inherits(MyParser, Parser);
+
+/**
+ * Of course you will have to define these functions somewhere
+ */
+```
This is very theoretic but you can have a look at what is in the example
folder
Please sign in to comment.
Something went wrong with that request. Please try again.