Class: AdLint::Cpp::CommaSeparatedExpression
- Inherits:
-
Expression
- Object
- SyntaxNode
- Expression
- AdLint::Cpp::CommaSeparatedExpression
- Defined in:
- lib/adlint/cpp/syntax.rb
Instance Attribute Summary collapse
-
#expressions ⇒ Object
writeonly
Sets the attribute expressions.
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(val) ⇒ CommaSeparatedExpression
constructor
A new instance of CommaSeparatedExpression.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #push(expression) ⇒ Object
- #to_s ⇒ Object
Methods inherited from SyntaxNode
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(val) ⇒ CommaSeparatedExpression
Returns a new instance of CommaSeparatedExpression.
912 913 914 915 |
# File 'lib/adlint/cpp/syntax.rb', line 912 def initialize(val) super(val) @expressions = [] end |
Instance Attribute Details
#expressions=(value) ⇒ Object (writeonly)
Sets the attribute expressions
917 918 919 |
# File 'lib/adlint/cpp/syntax.rb', line 917 def expressions=(value) @expressions = value end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
932 933 934 935 |
# File 'lib/adlint/cpp/syntax.rb', line 932 def inspect(indent = 0) ([" " * indent + short_class_name] + @expressions.map { |expr| expr.inspect(indent + 1) }).join("\n") end |
#location ⇒ Object
919 920 921 |
# File 'lib/adlint/cpp/syntax.rb', line 919 def location @expressions.first.location end |
#push(expression) ⇒ Object
927 928 929 930 |
# File 'lib/adlint/cpp/syntax.rb', line 927 def push(expression) @expressions.push(expression) self end |
#to_s ⇒ Object
923 924 925 |
# File 'lib/adlint/cpp/syntax.rb', line 923 def to_s @expressions.map { |expr| expr.to_s }.join(",") end |