We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7451473 commit fc4125bCopy full SHA for fc4125b
src/parser/JavaScript-rudus.ts
@@ -7,6 +7,7 @@ import {
7
whitespace,
8
between,
9
} from "rudus";
10
+import { IParser } from "../Interfaces";
11
12
const betweenDoubleQuotes = between(string('"'));
13
const optionalWhitespace = optional(whitespace());
@@ -41,10 +42,8 @@ const variableParser = sequenceOf([
41
42
variableValue.map(state => `<span style="color:blue">${state.result}</span>`),
43
]);
44
-const parserResult = variableParser.run("const isCool = null");
45
-
46
-if (parserResult.isError) {
47
- console.log(parserResult.errorMessage);
48
-} else {
49
- console.log(parserResult.result);
+export class JavaScriptRudusParser implements IParser {
+ parse(input: string) {
+ return variableParser.run(input);
+ }
50
}
0 commit comments