Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

homunculus

Package Overview
Dependencies
Maintainers
2
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homunculus - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

.idea/codeStyleSettings.xml

2

package.json
{
"name": "homunculus",
"version": "0.5.4",
"version": "0.5.5",
"description": "A lexer&parser by Javascript",

@@ -5,0 +5,0 @@ "maintainers": [

@@ -28,2 +28,3 @@ # A lexer&parser by Javascript

* token
* rule
* lan:

@@ -131,8 +132,13 @@ * js

* constructor(keyWords:Array<String>, supportPerlReg:Boolean = false) 关键字列表和是否支持perl风格的正则表达式
* addKeyWord(kw:String):Object 添加未知关键字并返回关键字hash
* addKeyWord(kw:String):Object 添加未知关键字并返回关键字hash,仅限此次对象分析
#### 特别的,对于css还可以设置添加属性和颜色别名
* addValue(v:String):Object 添加未知属性并返回属性hash
* addColor(c:String):Object 添加未知颜色并返回颜色hash
* addValue(v:String):Object 添加未知属性并返回属性hash,仅限此次对象分析
* addColor(c:String):Object 添加未知颜色并返回颜色hash,仅限此次对象分析
#### 亦可使用静态方法统一添加关键字等,一劳永逸
* addKeyWord(kw:String):Array<String>
* addValue(v:String):Array<String>
* addColor(c:String):Array<String>
## AST

@@ -139,0 +145,0 @@ 当调用语法分析器解析后,会返回生成ast,这是一个树状数据结构,每个节点都是对应语法解析器目录下的Node.js的实例。<br/>

@@ -101,2 +101,18 @@ var Lexer = require('./lexer/Lexer');

return Token;
case 'rule':
switch (lan) {
case 'js':
case 'javascript':
case 'es':
case 'es5':
case 'ecmascript':
return EcmascriptRule;
case 'css':
return CssRule;
case 'htm':
case 'html':
return HtmlRule;
default:
throw new Error('Unsupport Language Context: ' + lan);
}
default:

@@ -103,0 +119,0 @@ throw new Error('Unsupport Class Type: ' + type);

@@ -130,4 +130,28 @@ var Rule = require('./Rule');

VALUES: 'farthest-corner closest-side closest-corner farthest-side above absolute additive all alpha alphabetic always and antialiased aqua armenian attr aural auto avoid background baseline behind below bicubic bidi-override black blink block blue bold bolder border-box both bottom braille break-all break-word calc canvas capitalize caption center center-left center-right circle cjk-decimal cjk-ideographic close-quote code collapse color compact condensed contain content-box continuous counter counters cover crop cross cross-fade crosshair cubic-bezier cursive cycle cyclic dashed decimal decimal-leading-zero default device-cmyk digits disabled disc disclosure-closed disclosure-open dotted double e-resize ease ease-in ease-in-out ease-out element embed embossed enabled expanded extra-condensed extra-expanded false fantasy far-left far-right fast faster fixed flipouttobottom flipouttoleft flipouttoright flipouttotop format fuchsia georgian gray grayscale green groove handheld hebrew help hidden hide high higher hiragana hiragana-iroha hsl hsla icon image image-rect image-region infinite inherit inline inline-table inset inside inter-ideograph invert italic japanese-formal japanese-informal justify katakana katakana-iroha korean-hangul-formal korean-hanja-formal korean-hanja-informal landscape large larger leader left-side leftwards level lighter lime line-through linear linear-gradient list-item local loud low lower lower-alpha lower-greek lower-latin lower-roman lowercase ltr marker maroon medium message-box middle min max mix move n-resize narrower navy ne-resize no-close-quote no-open-quote no-repeat none normal not nowrap numeric nw-resize oblique olive once only opacity open-quote outset outside overline padding-box pending perspective pointer portrait pre print projection purple rebeccapurple rect red relative repeat repeat-x repeat-y repeating-linear-gradient repeating-radial-gradient rgb rgba ridge right right-side rightwards rotate rotate3d rotateX rotateY rotateZ round rounddown roundup rtl run-in running s-resize scale scale3D scaleX scaleY scaleZ screen scroll se-resize semi-condensed semi-expanded separate show silent silver simp-chinese-formal simp-chinese-informal skew skew3D skewX skewY skewZ slow slower small small-caps small-caption smaller soft solid space speech spell-out square static status-bar steps string sub super sw-resize symbolic symbols table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group target-counter target-counters target-pull target-text teal text text-bottom text-top thick thin toggle top trad-chinese-formal trad-chinese-informal translate translate3d translateX translateY translateZ true tty tv ultra-condensed ultra-expanded underline upper-alpha upper-latin upper-roman uppercase url var visible w-resize wait white wider width x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'.split(' '),
COLORS: 'transparent activeborder aliceblue antiquewhite appworkspace aqua aqua aquamarine azure beige bisque black black blanchedalmond blue blue blueviolet brown burlywood buttonface buttonshadow cadetblue captiontext chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia fuchsia gainsboro ghostwhite gold goldenrod gray gray green green greenyellow grey highlight honeydew hotpink inactiveborder inactivecaptiontext indianred indigo infotext ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime lime limegreen linen magenta maroon maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred menutext midnightblue mintcream mistyrose moccasin navajowhite navy navy oldlace olive olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple purple red red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal teal thistle threeddarkshadow threedhighlight threedshadow tomato turquoise violet wheat white white whitesmoke windowframe yellow yellow yellowgreen'.split(' ')
COLORS: 'transparent activeborder aliceblue antiquewhite appworkspace aqua aqua aquamarine azure beige bisque black black blanchedalmond blue blue blueviolet brown burlywood buttonface buttonshadow cadetblue captiontext chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia fuchsia gainsboro ghostwhite gold goldenrod gray gray green green greenyellow grey highlight honeydew hotpink inactiveborder inactivecaptiontext indianred indigo infotext ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime lime limegreen linen magenta maroon maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred menutext midnightblue mintcream mistyrose moccasin navajowhite navy navy oldlace olive olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple purple red red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal teal thistle threeddarkshadow threedhighlight threedshadow tomato turquoise violet wheat white white whitesmoke windowframe yellow yellow yellowgreen'.split(' '),
addKeyWord: function(kw) {
if(Array.isArray(kw)) {
CssRule.KEYWORDS = CssRule.KEYWORDS.concat(kw);
}
else {
CssRule.KEYWORDS.push(kw.trim());
}
},
addValue: function(v) {
if(Array.isArray(v)) {
CssRule.VALUES = CssRule.VALUES.concat(v);
}
else {
CssRule.VALUES.push(v.trim());
}
},
addColor: function(v) {
if(Array.isArray(v)) {
CssRule.COLORS = CssRule.COLORS.concat(v);
}
else {
CssRule.COLORS.push(v.trim());
}
}
});
module.exports = CssRule;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc