less 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.0.5
data/less.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{less}
5
- s.version = "1.0.4"
5
+ s.version = "1.0.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["cloudhead"]
@@ -176,7 +176,7 @@ grammar Less
176
176
  # [type="text"]
177
177
  #
178
178
  rule attribute
179
- '[' [a-z]+ ([|~]? '=')? (tag / string) ']'
179
+ '[' tag ([|~]? '=') (tag / string) ']' / '[' (tag / string) ']'
180
180
  end
181
181
 
182
182
  rule class
@@ -192,7 +192,7 @@ grammar Less
192
192
  end
193
193
 
194
194
  rule select
195
- (s [:+>] s / S)?
195
+ (s [+>] s / s ':' / S)?
196
196
  end
197
197
 
198
198
  # TODO: Merge this with attribute rule
@@ -369,6 +369,6 @@ grammar Less
369
369
 
370
370
  # Non-space char
371
371
  rule ns
372
- ![ ;] .
372
+ ![ ;\n] .
373
373
  end
374
374
  end
@@ -1875,6 +1875,13 @@ module Less
1875
1875
  end
1876
1876
 
1877
1877
  module Attribute1
1878
+ def tag
1879
+ elements[1]
1880
+ end
1881
+
1882
+ end
1883
+
1884
+ module Attribute2
1878
1885
  end
1879
1886
 
1880
1887
  def _nt_attribute
@@ -1885,108 +1892,137 @@ module Less
1885
1892
  return cached
1886
1893
  end
1887
1894
 
1888
- i0, s0 = index, []
1895
+ i0 = index
1896
+ i1, s1 = index, []
1889
1897
  if has_terminal?('[', false, index)
1890
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
1898
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
1891
1899
  @index += 1
1892
1900
  else
1893
1901
  terminal_parse_failure('[')
1894
- r1 = nil
1902
+ r2 = nil
1895
1903
  end
1896
- s0 << r1
1897
- if r1
1898
- s2, i2 = [], index
1899
- loop do
1900
- if has_terminal?('[a-z]', true, index)
1901
- r3 = true
1902
- @index += 1
1903
- else
1904
- r3 = nil
1905
- end
1906
- if r3
1907
- s2 << r3
1908
- else
1909
- break
1910
- end
1911
- end
1912
- if s2.empty?
1913
- @index = i2
1914
- r2 = nil
1915
- else
1916
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1917
- end
1918
- s0 << r2
1919
- if r2
1920
- i5, s5 = index, []
1904
+ s1 << r2
1905
+ if r2
1906
+ r3 = _nt_tag
1907
+ s1 << r3
1908
+ if r3
1909
+ i4, s4 = index, []
1921
1910
  if has_terminal?('[|~]', true, index)
1922
- r7 = true
1911
+ r6 = true
1923
1912
  @index += 1
1924
1913
  else
1925
- r7 = nil
1914
+ r6 = nil
1926
1915
  end
1927
- if r7
1928
- r6 = r7
1916
+ if r6
1917
+ r5 = r6
1929
1918
  else
1930
- r6 = instantiate_node(SyntaxNode,input, index...index)
1919
+ r5 = instantiate_node(SyntaxNode,input, index...index)
1931
1920
  end
1932
- s5 << r6
1933
- if r6
1921
+ s4 << r5
1922
+ if r5
1934
1923
  if has_terminal?('=', false, index)
1935
- r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
1924
+ r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
1936
1925
  @index += 1
1937
1926
  else
1938
1927
  terminal_parse_failure('=')
1939
- r8 = nil
1928
+ r7 = nil
1940
1929
  end
1941
- s5 << r8
1942
- end
1943
- if s5.last
1944
- r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
1945
- r5.extend(Attribute0)
1946
- else
1947
- @index = i5
1948
- r5 = nil
1930
+ s4 << r7
1949
1931
  end
1950
- if r5
1951
- r4 = r5
1932
+ if s4.last
1933
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
1934
+ r4.extend(Attribute0)
1952
1935
  else
1953
- r4 = instantiate_node(SyntaxNode,input, index...index)
1936
+ @index = i4
1937
+ r4 = nil
1954
1938
  end
1955
- s0 << r4
1939
+ s1 << r4
1956
1940
  if r4
1957
- i9 = index
1958
- r10 = _nt_tag
1959
- if r10
1960
- r9 = r10
1941
+ i8 = index
1942
+ r9 = _nt_tag
1943
+ if r9
1944
+ r8 = r9
1961
1945
  else
1962
- r11 = _nt_string
1963
- if r11
1964
- r9 = r11
1946
+ r10 = _nt_string
1947
+ if r10
1948
+ r8 = r10
1965
1949
  else
1966
- @index = i9
1967
- r9 = nil
1950
+ @index = i8
1951
+ r8 = nil
1968
1952
  end
1969
1953
  end
1970
- s0 << r9
1971
- if r9
1954
+ s1 << r8
1955
+ if r8
1972
1956
  if has_terminal?(']', false, index)
1973
- r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
1957
+ r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
1974
1958
  @index += 1
1975
1959
  else
1976
1960
  terminal_parse_failure(']')
1977
- r12 = nil
1961
+ r11 = nil
1978
1962
  end
1979
- s0 << r12
1963
+ s1 << r11
1980
1964
  end
1981
1965
  end
1982
1966
  end
1983
1967
  end
1984
- if s0.last
1985
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1986
- r0.extend(Attribute1)
1968
+ if s1.last
1969
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1970
+ r1.extend(Attribute1)
1987
1971
  else
1988
- @index = i0
1989
- r0 = nil
1972
+ @index = i1
1973
+ r1 = nil
1974
+ end
1975
+ if r1
1976
+ r0 = r1
1977
+ else
1978
+ i12, s12 = index, []
1979
+ if has_terminal?('[', false, index)
1980
+ r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
1981
+ @index += 1
1982
+ else
1983
+ terminal_parse_failure('[')
1984
+ r13 = nil
1985
+ end
1986
+ s12 << r13
1987
+ if r13
1988
+ i14 = index
1989
+ r15 = _nt_tag
1990
+ if r15
1991
+ r14 = r15
1992
+ else
1993
+ r16 = _nt_string
1994
+ if r16
1995
+ r14 = r16
1996
+ else
1997
+ @index = i14
1998
+ r14 = nil
1999
+ end
2000
+ end
2001
+ s12 << r14
2002
+ if r14
2003
+ if has_terminal?(']', false, index)
2004
+ r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
2005
+ @index += 1
2006
+ else
2007
+ terminal_parse_failure(']')
2008
+ r17 = nil
2009
+ end
2010
+ s12 << r17
2011
+ end
2012
+ end
2013
+ if s12.last
2014
+ r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
2015
+ r12.extend(Attribute2)
2016
+ else
2017
+ @index = i12
2018
+ r12 = nil
2019
+ end
2020
+ if r12
2021
+ r0 = r12
2022
+ else
2023
+ @index = i0
2024
+ r0 = nil
2025
+ end
1990
2026
  end
1991
2027
 
1992
2028
  node_cache[:attribute][start_index] = r0
@@ -2206,6 +2242,13 @@ module Less
2206
2242
  end
2207
2243
  end
2208
2244
 
2245
+ module Select1
2246
+ def s
2247
+ elements[0]
2248
+ end
2249
+
2250
+ end
2251
+
2209
2252
  def _nt_select
2210
2253
  start_index = index
2211
2254
  if node_cache[:select].has_key?(index)
@@ -2219,7 +2262,7 @@ module Less
2219
2262
  r3 = _nt_s
2220
2263
  s2 << r3
2221
2264
  if r3
2222
- if has_terminal?('[:+>]', true, index)
2265
+ if has_terminal?('[+>]', true, index)
2223
2266
  r4 = true
2224
2267
  @index += 1
2225
2268
  else
@@ -2241,12 +2284,36 @@ module Less
2241
2284
  if r2
2242
2285
  r1 = r2
2243
2286
  else
2244
- r6 = _nt_S
2287
+ i6, s6 = index, []
2288
+ r7 = _nt_s
2289
+ s6 << r7
2290
+ if r7
2291
+ if has_terminal?(':', false, index)
2292
+ r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
2293
+ @index += 1
2294
+ else
2295
+ terminal_parse_failure(':')
2296
+ r8 = nil
2297
+ end
2298
+ s6 << r8
2299
+ end
2300
+ if s6.last
2301
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
2302
+ r6.extend(Select1)
2303
+ else
2304
+ @index = i6
2305
+ r6 = nil
2306
+ end
2245
2307
  if r6
2246
2308
  r1 = r6
2247
2309
  else
2248
- @index = i1
2249
- r1 = nil
2310
+ r9 = _nt_S
2311
+ if r9
2312
+ r1 = r9
2313
+ else
2314
+ @index = i1
2315
+ r1 = nil
2316
+ end
2250
2317
  end
2251
2318
  end
2252
2319
  if r1
@@ -3816,7 +3883,7 @@ module Less
3816
3883
 
3817
3884
  i0, s0 = index, []
3818
3885
  i1 = index
3819
- if has_terminal?('[ ;]', true, index)
3886
+ if has_terminal?('[ ;\\n]', true, index)
3820
3887
  r2 = true
3821
3888
  @index += 1
3822
3889
  else
data/spec/css/css-1.0.css CHANGED
@@ -20,6 +20,7 @@ p:first-child { text-transform: none; }
20
20
  q:lang(no) { quotes: none; }
21
21
  p + h1 { font-size: 2.2em; }
22
22
  input[type="text"] { font-weight: normal; }
23
+ h2[title] { font-size: 100%; }
23
24
  #shorthands {
24
25
  border: 1px solid #000000;
25
26
  font: 12px/16px Arial;
@@ -7,3 +7,7 @@
7
7
  .space { color: white; }
8
8
  .mania { color: white; }
9
9
  .no-semi-column { color: white; }
10
+ .no-semi-column {
11
+ color: white;
12
+ white-space: pre;
13
+ }
@@ -60,6 +60,10 @@ input[type="text"] {
60
60
  font-weight: normal;
61
61
  }
62
62
 
63
+ h2[title] {
64
+ font-size: 100%;
65
+ }
66
+
63
67
  #shorthands {
64
68
  border: 1px solid #000;
65
69
  font: 12px/16px Arial;
@@ -16,6 +16,10 @@
16
16
  { color: white; }
17
17
 
18
18
  .no-semi-column { color: white }
19
+ .no-semi-column {
20
+ color: white;
21
+ white-space: pre
22
+ }
19
23
  .empty {
20
24
 
21
25
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - cloudhead