Skip to content

Instantly share code, notes, and snippets.

@brianhempel
Created November 30, 2014 20:01
Show Gist options
  • Save brianhempel/ebaae6615c177ab1a509 to your computer and use it in GitHub Desktop.
Save brianhempel/ebaae6615c177ab1a509 to your computer and use it in GitHub Desktop.
Usage of Ruby constructs in the top 1000 Ruby repos on Github (by stars); as parsed by Ripper.sexp
15621016 :@ident
6122824 :var_ref
5547844 :args_add_block
4507766 :@tstring_content
4490030 :"."
4125221 :string_content
4125221 :string_literal
3757094 :call
2890433 :method_add_arg
2696463 :arg_paren
2584504 :@const
2022252 :symbol_literal
2010496 :symbol
1928627 :@int
1668326 :command
1364478 :fcall
1279333 :assign
1174164 :method_add_block
1159115 :assoc_new
1074974 :@ivar
1072364 :var_field
960480 :params
925601 :bodystmt
914999 :vcall
871378 :array
858692 :do_block
792184 :binary
704497 :@kw
652716 :const_path_ref
611425 :def
580717 :command_call
475582 :aref
381210 :bare_assoc_hash
367993 :paren
353211 :string_embexpr <------------
315472 :brace_block
289445 :block_var
255810 :==
244253 :hash
212889 :const_ref
199609 :@label
173642 :assoclist_from_args
169139 :if
157490 :program
155267 :field
138270 :void_stmt
131274 :class
127050 :aref_field
120435 :@regexp_end
120435 :regexp_literal
115312 :if_mod
109281 :<<
106923 :+
101677 :unary
96213 :module
89889 :else
78488 :@op
61484 :opassign
57129 :return
55782 :when
54377 :@period
54309 :defs
51966 :"||"
49099 :"&&"
48501 :unless_mod
47175 :@float
46707 :-@
45918 :!
43066 :@gvar
36198 :ifop
31075 :top_const_ref
28299 :args_add_star
27737 :rest_param
27351 :-
26807 :rescue
26582 :*
25899 :dyna_symbol
25828 :massign
25791 :=~
25251 :begin
23358 :elsif
23353 :unless
20808 :and
19300 :dot2
18578 :return0
17720 :case
17190 :blockarg
16888 :>
15883 :!=
15662 :@backref
15137 :zsuper
13687 :/
12486 :@cvar
12448 :<
11895 :super
11775 :defined
11348 :next
9680 :ensure
9671 :yield
9634 :%
9632 :or
9588 :mrhs_new_from_args
9030 :alias
8239 :not
8220 :break
7502 :while
7129 :sclass
6520 :>=
6349 :mlhs_paren
5917 :|
5584 :dot3
5504 :yield0
5440 :xstring_literal
5301 :lambda
5063 :===
4917 :rescue_mod
4854 :&
4785 :**
4420 :@CHAR
4312 :<=
4035 :string_concat
3966 :<=>
2155 :!~
2079 :>>
2076 :"::"
1941 :for
1649 :mrhs_add_star
1517 :mlhs_add_star
1376 :string_dvar <------------
1284 :while_mod
1095 :until
819 :until_mod
786 :undef
781 :const_path_field
750 :^
732 :retry
537 :~
276 :+@
201 :@backtick
134 :redo
117 :var_alias
114 :assoc_splat
98 :top_const_field
37 :@rational
30 :@imaginary
27 :END
21 :param_error
12 :BEGIN
6 :class_name_error
5 :assign_error
1 :alias_error
@brianhempel
Copy link
Author

Technically, these results also include my repo download script and my counting script. Oops. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment