lucid-tdl 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,6 +60,9 @@ class LucidTDL::Parser < Racc::Parser
60
60
  when (text = @ss.scan(/[ \t]+/))
61
61
  ;
62
62
 
63
+ when (text = @ss.scan(/\#.*$/))
64
+ ;
65
+
63
66
  when (text = @ss.scan(/\n/))
64
67
  action { [:NEWLINE, text] }
65
68
 
@@ -105,7 +108,7 @@ class LucidTDL::Parser < Racc::Parser
105
108
  when (text = @ss.scan(/\*/))
106
109
  action { [:GENERIC, text] }
107
110
 
108
- when (text = @ss.scan(/[^\n]*/))
111
+ when (text = @ss.scan(/[^#\n]*/))
109
112
  action { [:TEXT, text.strip] }
110
113
 
111
114
  else
@@ -5,6 +5,7 @@ macro
5
5
 
6
6
  rule
7
7
  {BLANK} # no action
8
+ \#.*$ # no action
8
9
 
9
10
  \n { [:NEWLINE, text] }
10
11
 
@@ -26,7 +27,7 @@ rule
26
27
  But { [:BUT, text] }
27
28
  \* { [:GENERIC, text] }
28
29
 
29
- [^\n]* { [:TEXT, text.strip] }
30
+ [^#\n]* { [:TEXT, text.strip] }
30
31
 
31
32
  inner
32
33
  def tokenize(code)
@@ -1,3 +1,3 @@
1
1
  module LucidTDL
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -6,6 +6,10 @@ module LucidTDL
6
6
  @lexer = Parser.new
7
7
  end
8
8
 
9
+ it "will ignore commented lines" do
10
+ @lexer.tokenize("# Commented line").must_equal []
11
+ end
12
+
9
13
  it "can parse a single newline character" do
10
14
  @lexer.tokenize("\n").must_equal [[:NEWLINE, "\n"]]
11
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid-tdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-12 00:00:00.000000000 Z
12
+ date: 2012-12-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Test Description Language
15
15
  email: