- # Can be inlined if:
- # * block is empty or can be inlined
- # * contains no comments
- redef fun is_inlinable do
- if not super then return false
- if n_annotations != null and not n_annotations.is_inlinable then return false
- if n_block != null and not n_block.is_inlinable then return false
- if not collect_comments.is_empty then return false
- return true
- end
-end
-
-redef class AMainMethPropdef
- redef fun accept_pretty_printer(v) do
- v.visit n_block
- v.addn
- end
-end
-
-redef class ADeferredMethPropdef
- redef fun accept_pretty_printer(v) do
- super
- if n_annotations == null then
- while not v.current_token isa TKwis do v.skip
- v.consume "is"
- v.adds
- while not v.current_token isa TKwabstract do v.skip
- v.consume "abstract"
- end
- v.finish_line
- v.addn
- end
-end
-
-redef class AExternPropdef
- redef fun accept_pretty_printer(v) do
- super
- while v.current_token isa TEol do v.skip
-
- if v.current_token isa TKwis then
- v.consume "is"
- v.adds
- end
-
- if v.current_token isa TKwextern then
- v.consume "extern"
- v.adds
+ if n_extern_calls != null or n_extern_code_block != null then
+ if n_annotations != null then v.adds
+ if n_extern_calls != null then v.visit n_extern_calls
+ if n_extern_code_block != null then v.visit n_extern_code_block