|
|
|
@ -13,12 +13,14 @@ module Docs
|
|
|
|
|
['... splats', 'splats', 'Language'],
|
|
|
|
|
['for...in', 'loops', 'Statements'],
|
|
|
|
|
['for...in...by', 'loops', 'Statements'],
|
|
|
|
|
['for...in...when', 'loops', 'Statements'],
|
|
|
|
|
['for...of', 'loops', 'Statements'],
|
|
|
|
|
['while', 'loops', 'Statements'],
|
|
|
|
|
['until', 'loops', 'Statements'],
|
|
|
|
|
['loop', 'loops', 'Statements'],
|
|
|
|
|
['do', 'loops', 'Statements'],
|
|
|
|
|
['Array slicing and splicing', 'slices', 'Language'],
|
|
|
|
|
['Ranges', 'slices', 'Language'],
|
|
|
|
|
['Expressions', 'expressions', 'Language'],
|
|
|
|
|
['?', 'the-existential-operator', 'Operators'],
|
|
|
|
|
['?=', 'the-existential-operator', 'Operators'],
|
|
|
|
@ -35,8 +37,10 @@ module Docs
|
|
|
|
|
['Chained comparisons', 'comparisons', 'Language'],
|
|
|
|
|
['#{} interpolation', 'strings', 'Language'],
|
|
|
|
|
['Block strings', 'strings', 'Language'],
|
|
|
|
|
['"""', 'strings', 'Language'],
|
|
|
|
|
['Block comments', 'strings', 'Language'],
|
|
|
|
|
['Block regular expressions', 'regexes', 'Language'],
|
|
|
|
|
['###', 'strings', 'Language'],
|
|
|
|
|
['Block regexes', 'regexes', 'Language'],
|
|
|
|
|
['cake command', 'cake', 'Miscellaneous'],
|
|
|
|
|
['Cakefile', 'cake', 'Miscellaneous'],
|
|
|
|
|
['Source maps', 'source-maps', 'Miscellaneous']
|
|
|
|
@ -49,7 +53,8 @@ module Docs
|
|
|
|
|
css('.definitions td:first-child > code').each do |node|
|
|
|
|
|
node.content.split(', ').each do |name|
|
|
|
|
|
next if %w(true false yes no on off this).include?(name)
|
|
|
|
|
id = name.parameterize
|
|
|
|
|
name.sub! %r{\Aa (.+) b\z}, '\1'
|
|
|
|
|
id = name_to_id(name)
|
|
|
|
|
node['id'] = id
|
|
|
|
|
entries << [name, id, 'Operators']
|
|
|
|
|
end
|
|
|
|
@ -57,6 +62,15 @@ module Docs
|
|
|
|
|
|
|
|
|
|
entries
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def name_to_id(name)
|
|
|
|
|
case name
|
|
|
|
|
when '**' then 'pow'
|
|
|
|
|
when '//' then 'floor'
|
|
|
|
|
when '%%' then 'mod'
|
|
|
|
|
else name.parameterize
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|