krl-parser
Advanced tools
Comparing version 0.11.1 to 0.12.0
{ | ||
"name": "krl-parser", | ||
"version": "0.11.1", | ||
"version": "0.12.0", | ||
"description": "Parse KRL source code into an AST", | ||
@@ -41,2 +41,3 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"comment-regex": "^1.0.0", | ||
"excerpt-at-line-col": "^1.0.0", | ||
@@ -43,0 +44,0 @@ "line-column": "^1.0.2", |
@@ -40,13 +40,2 @@ # krl-parser | ||
### name = extractRulesetName(src) | ||
* `src` - your krl source code string | ||
This function return the ruleset name. Or `undefined` if it's unable to parse it. This is handy when you need the ruleset name without the overhead of parsing the entire file. | ||
```js | ||
var extractRulesetName = require('krl-parser/src/extractRulesetName'); | ||
name = extractRulesetName('ruleset blah { ... }'); | ||
//-> "blah" | ||
``` | ||
## Developing | ||
@@ -53,0 +42,0 @@ |
@@ -1,7 +0,7 @@ | ||
var commentsRegExp = require('./commentsRegExp'); | ||
var commentsRegExp = require('comment-regex'); | ||
module.exports = function(src){ | ||
return src.replace(commentsRegExp, function(rep){ | ||
return src.replace(commentsRegExp(), function(rep){ | ||
return rep.replace(/[^\n]/g, ' '); | ||
}); | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
93948
4
7
937
65
+ Addedcomment-regex@^1.0.0
+ Addedcomment-regex@1.0.1(transitive)