nasl 0.1.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1211036372f4f6f5cf6638769d1de8d46720ffd
4
- data.tar.gz: 996d639bae9ddda1394e59745c19eafaca51eb45
3
+ metadata.gz: f7f194e85bfffd0d60eeba8e2e0c9731fefb8efd
4
+ data.tar.gz: d1ae8dbd9a8f4cfa6bdea898acb19c6e07715e28
5
5
  SHA512:
6
- metadata.gz: d376f113cf2fead0955db0b34a56855128f6c8dee42999fbb4173857b649de5ffe31aa3db31129f1879af46ed6c73adb8a7381e46d92cebbb4ae078bca6b5c5d
7
- data.tar.gz: 8c90427b235c11cfffae66f294125dfd2094af5fe8cce28701867d84a9e9de95cfc5cba2bf33206cc3eb9b8e49556405a5293fdabac50bb2e9075af956239345
6
+ metadata.gz: 127f28c3d561498967aedd5de3ae092eec8327b1781a8a7321934fb40c617f2aab5940b6ff1f6bdfeb90b1122f1489f2b83a42273a4a8dcbdeb54ddddb28aeba
7
+ data.tar.gz: 25f4fc9e456ad37df32f2fe6999ec3fa62089511d2d71a6703772ef454da6bbde0ba80b140051dc007a0b792693d4d358d21e13c585e6bd7f85215425236a29c
@@ -0,0 +1,18 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - 2.1.0
7
+
8
+ gemfile:
9
+ - Gemfile.ci
10
+
11
+ notifications:
12
+ email:
13
+ - jhammack@tenable.com
14
+ - aweber@tenable.com
15
+
16
+ before_install:
17
+ - gem --version
18
+
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- source 'http://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in nasl.gemspec
4
- gemspec
3
+ gem "racc", '1.4.12'
4
+ gem "rake", '10.3.2'
5
+ gem "builder", '3.2.2'
6
+ gem "rainbow", '2.0.0'
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "racc", '1.4.12'
4
+ gem "rake", '10.3.2'
5
+ gem "builder", '3.2.2'
6
+ gem "rainbow", '2.0.0'
@@ -195,7 +195,7 @@ rule
195
195
  ;
196
196
 
197
197
  rep : call_exp REP expr SEMICOLON
198
- { n(:Repetition, n(:Call, val[0]), *val[1..-1]) }
198
+ { n(:Repetition, *val[0..-1]) }
199
199
  ;
200
200
 
201
201
  return : RETURN expr SEMICOLON
@@ -48,7 +48,7 @@ module Nasl
48
48
  end
49
49
 
50
50
  def region
51
- @tokens.first.region.begin..@tokens.last.region.end
51
+ @tokens.flatten.first.region.begin..@tokens.flatten.last.region.end
52
52
  end
53
53
 
54
54
  def to_xml(xml)
@@ -25,5 +25,5 @@
25
25
  ################################################################################
26
26
 
27
27
  module Nasl
28
- VERSION = '0.1.1'
28
+ VERSION = '0.2.0'
29
29
  end
@@ -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.1.1
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-27 00:00:00.000000000 Z
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