Skip to content

Commit

Permalink
Avoid definition anti-pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-w committed Dec 15, 2020
1 parent 9590e13 commit 6892d95
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 5 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ language. It is dynamic while providing a programming model designed
to support efficient machine code generation, including fine-grained
control over dynamic and static behaviors.

# Example

var dylanGrammar = require('highlight-dylan')
hljs.registerLanguage('dylan', dylanGrammar)

See https://github.com/highlightjs/highlight.js
and https://opendylan.org/

6 changes: 1 addition & 5 deletions dylan.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,4 @@ function hljsDefineDylan(hljs) {
return DYLAN_CODE;
}

module.exports = function(hljs) {
hljs.registerLanguage('dylan', hljsDefineDylan);
};

module.exports.definer = hljsDefineDylan;
module.exports = hljsDefineDylan;
7 changes: 3 additions & 4 deletions spec/dylan-spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const hljs = require("highlight.js/lib/highlight");
const {
definer: dylan
} = require("../dylan");
const dylanGrammar = require("../dylan");
const fs = require("fs");
const path = require("path");
hljs.registerLanguage("dylan", dylan);

hljs.registerLanguage("dylan", dylanGrammar);

describe("respec-highlight bundle", () => {
it("highlights dylan", () => {
Expand Down

0 comments on commit 6892d95

Please sign in to comment.