Class: Mulang::Language::Base
- Inherits:
-
Object
- Object
- Mulang::Language::Base
- Defined in:
- lib/mulang/language.rb
Instance Method Summary collapse
- #ast(content, **options) ⇒ Object
- #ast_analysis(content, **options) ⇒ Object
- #identifiers(content, **options) ⇒ Object
- #identifiers_analysis(content, **options) ⇒ Object
- #normalization_options(**options) ⇒ Object
- #transformed_asts(content, operations, **options) ⇒ Object
- #transformed_asts_analysis(content, operations, **options) ⇒ Object
Instance Method Details
#ast(content, **options) ⇒ Object
23 24 25 |
# File 'lib/mulang/language.rb', line 23 def ast(content, **) Mulang.analyse(ast_analysis(content, **), **)['outputAst'] rescue nil end |
#ast_analysis(content, **options) ⇒ Object
27 28 29 |
# File 'lib/mulang/language.rb', line 27 def ast_analysis(content, **) base_analysis content, {includeOutputAst: true}, ** end |
#identifiers(content, **options) ⇒ Object
3 4 5 |
# File 'lib/mulang/language.rb', line 3 def identifiers(content, **) Mulang.analyse(identifiers_analysis(content, **), **)['outputIdentifiers'] rescue nil end |
#identifiers_analysis(content, **options) ⇒ Object
7 8 9 |
# File 'lib/mulang/language.rb', line 7 def identifiers_analysis(content, **) base_analysis content, {includeOutputIdentifiers: true}, ** end |
#normalization_options(**options) ⇒ Object
19 20 21 |
# File 'lib/mulang/language.rb', line 19 def (**) .except(:serialization).presence end |
#transformed_asts(content, operations, **options) ⇒ Object
11 12 13 |
# File 'lib/mulang/language.rb', line 11 def transformed_asts(content, operations, **) Mulang.analyse(transformed_asts_analysis(content, operations, **), **)['transformedAsts'] rescue nil end |
#transformed_asts_analysis(content, operations, **options) ⇒ Object
15 16 17 |
# File 'lib/mulang/language.rb', line 15 def transformed_asts_analysis(content, operations, **) base_analysis content, {transformationSpecs: operations}, ** end |