nasl 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +18 -0
- data/Gemfile +5 -3
- data/Gemfile.ci +6 -0
- data/lib/nasl/grammar.racc +1 -1
- data/lib/nasl/parser/node.rb +1 -1
- data/lib/nasl/version.rb +1 -1
- data/test/unit/parser/test_repetition.rb +46 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7f194e85bfffd0d60eeba8e2e0c9731fefb8efd
|
4
|
+
data.tar.gz: d1ae8dbd9a8f4cfa6bdea898acb19c6e07715e28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 127f28c3d561498967aedd5de3ae092eec8327b1781a8a7321934fb40c617f2aab5940b6ff1f6bdfeb90b1122f1489f2b83a42273a4a8dcbdeb54ddddb28aeba
|
7
|
+
data.tar.gz: 25f4fc9e456ad37df32f2fe6999ec3fa62089511d2d71a6703772ef454da6bbde0ba80b140051dc007a0b792693d4d358d21e13c585e6bd7f85215425236a29c
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Gemfile.ci
ADDED
data/lib/nasl/grammar.racc
CHANGED
data/lib/nasl/parser/node.rb
CHANGED
data/lib/nasl/version.rb
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
################################################################################
|
2
|
+
# Copyright (c) 2011-2014, Tenable Network Security
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# 1. Redistributions of source code must retain the above copyright notice, this
|
9
|
+
# list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
19
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
21
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
22
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
23
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
24
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
################################################################################
|
26
|
+
|
27
|
+
class TestRepetition < Test::Unit::TestCase
|
28
|
+
include Nasl::Test
|
29
|
+
|
30
|
+
def test_does
|
31
|
+
pass("exit() x 10;");
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_two_args
|
35
|
+
tree = parse("exit(2, 3) x 10;")
|
36
|
+
assert_not_nil(tree)
|
37
|
+
|
38
|
+
calls = tree.all(:Call)
|
39
|
+
assert_not_nil(calls)
|
40
|
+
assert_equal(1, calls.length)
|
41
|
+
|
42
|
+
call = calls.first
|
43
|
+
assert_not_nil(call)
|
44
|
+
assert_equal(2, call.args.length)
|
45
|
+
end
|
46
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nasl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mak Kolybabi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-08-
|
13
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: racc
|
@@ -80,7 +80,9 @@ extensions: []
|
|
80
80
|
extra_rdoc_files: []
|
81
81
|
files:
|
82
82
|
- ".gitignore"
|
83
|
+
- ".travis.yml"
|
83
84
|
- Gemfile
|
85
|
+
- Gemfile.ci
|
84
86
|
- README.md
|
85
87
|
- Rakefile
|
86
88
|
- bin/nasl-parse
|
@@ -157,6 +159,7 @@ files:
|
|
157
159
|
- test/unit/parser/test_ip.rb
|
158
160
|
- test/unit/parser/test_list.rb
|
159
161
|
- test/unit/parser/test_local.rb
|
162
|
+
- test/unit/parser/test_repetition.rb
|
160
163
|
- test/unit/parser/test_return.rb
|
161
164
|
- test/unit/parser/test_string.rb
|
162
165
|
- test/unit/parser/test_whitespace.rb
|
@@ -210,6 +213,7 @@ test_files:
|
|
210
213
|
- test/unit/parser/test_ip.rb
|
211
214
|
- test/unit/parser/test_list.rb
|
212
215
|
- test/unit/parser/test_local.rb
|
216
|
+
- test/unit/parser/test_repetition.rb
|
213
217
|
- test/unit/parser/test_return.rb
|
214
218
|
- test/unit/parser/test_string.rb
|
215
219
|
- test/unit/parser/test_whitespace.rb
|