ucd 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/ucd/parser.rb +8 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdaec7d175f5ab56710dc4b64d3e79ab6ad9a076
4
- data.tar.gz: dada32605eab973771134ddf2bc3c62549cdd4d6
3
+ metadata.gz: bded63756cb059b1bf533324437fce70480ef263
4
+ data.tar.gz: 3d501486676a8d08b794ee646990935dc7b323fd
5
5
  SHA512:
6
- metadata.gz: 1128275fe76fb04862fd555650f37c78452e8bc5449101bfbd97810568bddcd923aa19f2515612e893b8dbc4d7045327c0a79209c8212d8304c144d0da699b9c
7
- data.tar.gz: d3a1c0a61fe3fece3f69fd0a8090a50ed1c499673ab7f2315b6a5a166f78383697fe52bd866017a4379f2658e271d697127f80b7ed35f5a4a1a2c5e425723f39
6
+ metadata.gz: 2ff41f9774f80876e95ffc19b66d2cda5f3048da368c678ba0f8aa6a19404a4b2c12f5938220369faee913a6672a1cdcf38fef1c369c03a700d104463d325c3c
7
+ data.tar.gz: 2f04d70df43b8f5be60acb6098f44b2b78576d0a8e20a6daac7974fd6daa41afb430d5cadac3e3ee4ec5989749ceaa3ba5eb61c92656b82a59736eb9217ca63f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/lib/ucd/parser.rb CHANGED
@@ -34,7 +34,10 @@ module UCD
34
34
  rule(:whitespace) { (match("\s") | match("\n") | str(";")).repeat(1) }
35
35
  rule(:whitespace?) { whitespace.maybe }
36
36
 
37
- rule(:name) { match["[:alnum:]_-"].repeat(1) } # TODO: Any other needed?
37
+ rule(:name) { match['a-zA-Z0-9_-'].repeat(1) }
38
+
39
+ rule(:class_name_chars) { match('(?:[a-zA-Z0-9_-]|\:|\.)').repeat(1) }
40
+ rule(:class_name) { class_name_chars >> (str("(") >> class_name_chars >> str(")")).maybe }
38
41
 
39
42
  # -- Field/Method
40
43
 
@@ -44,7 +47,7 @@ module UCD
44
47
  rule(:member_access) { (kw_access_modifier.as(:access) >> spaces).maybe }
45
48
 
46
49
  rule(:method_abstract) { (kw_abstract.as(:abstract) >> spaces).maybe }
47
- rule(:member_type) { (spaces >> str(":") >> spaces >> name.as(:type)).maybe }
50
+ rule(:member_type) { (spaces >> str(":") >> spaces >> class_name.as(:type)).maybe }
48
51
 
49
52
  rule(:field_keyword) { kw_field >> spaces }
50
53
  rule(:field_name) { name.as(:name) }
@@ -65,7 +68,7 @@ module UCD
65
68
  rule(:kw_class_relationship_type) { kw_generalizes | kw_realizes }
66
69
 
67
70
  rule(:class_relationship_type) { kw_class_relationship_type.as(:type) >> spaces }
68
- rule(:class_relationship_definition) { (class_relationship_type >> name.as(:name)).as(:class_relationship) }
71
+ rule(:class_relationship_definition) { (class_relationship_type >> class_name.as(:name)).as(:class_relationship) }
69
72
 
70
73
  # -- Relationship
71
74
 
@@ -76,7 +79,7 @@ module UCD
76
79
  rule(:relationship_type) { kw_relationship_type.as(:type) >> spaces }
77
80
  rule(:relationship_from) { (spaces >> (name.as(:name) | str("*").repeat(1)).as(:from)).maybe }
78
81
  rule(:relationship_to) { (spaces >> (name.as(:name) | str("*").repeat(1)).as(:to)).maybe }
79
- rule(:relationship_definition) { (relationship_directionality >> relationship_type >> name.as(:name) >> relationship_from >> relationship_to).as(:relationship) }
82
+ rule(:relationship_definition) { (relationship_directionality >> relationship_type >> class_name.as(:name) >> relationship_from >> relationship_to).as(:relationship) }
80
83
 
81
84
  # -- Class
82
85
 
@@ -89,7 +92,7 @@ module UCD
89
92
  rule(:class_body) { spaces? >> str("{") >> whitespace? >> class_inner_definition.repeat.as(:members) >> str("}") }
90
93
  rule(:class_body?) { class_body.maybe }
91
94
 
92
- rule(:class_definition) { class_modifier >> class_keyword >> name.as(:name) >> class_body? }
95
+ rule(:class_definition) { class_modifier >> class_keyword >> class_name.as(:name) >> class_body? }
93
96
 
94
97
  # -- Document
95
98
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Scott Lewis