minjs 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Minjs
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Issei Numata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-29 00:00:00.000000000 Z
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,7 +99,6 @@ files:
99
99
  - lib/minjs/expression.rb
100
100
  - lib/minjs/func.rb
101
101
  - lib/minjs/lex.rb
102
- - lib/minjs/literal.rb
103
102
  - lib/minjs/minjs_compressor.rb
104
103
  - lib/minjs/program.rb
105
104
  - lib/minjs/statement.rb
@@ -1,45 +0,0 @@
1
- module Minjs
2
- module Literal
3
- #
4
- # 7.8
5
- #
6
- def literal(lex, context)
7
- lex.eval_lit{
8
- a = lex.fwd_lit(:hint => :regexp)
9
- if a.kind_of?(ECMA262::ECMA262Numeric) || a.kind_of?(ECMA262::ECMA262String) || a.kind_of?(ECMA262::ECMA262RegExp)
10
- a
11
- else
12
- nil
13
- end
14
- } or lex.eval_lit{
15
- null_literal(lex, context)
16
- } or lex.eval_lit{
17
- boolean_literal(lex, context)
18
- }
19
- end
20
-
21
- #
22
- # 7.8.1
23
- #
24
- def null_literal(lex, context)
25
- if lex.match_lit(ECMA262::ID_NULL)
26
- ECMA262::Null.get
27
- else
28
- nil
29
- end
30
- end
31
-
32
- #
33
- # 7.8.2
34
- #
35
- def boolean_literal(lex, context)
36
- if lex.match_lit(ECMA262::ID_TRUE)
37
- ECMA262::Boolean.get(:true)
38
- elsif lex.match_lit(ECMA262::ID_FALSE)
39
- ECMA262::Boolean.get(:false)
40
- else
41
- nil
42
- end
43
- end
44
- end
45
- end