Closed cvigilv closed 6 months ago
Hi! I am currently seeing the following error whenever I want to parse the following example:
X = [1,2,3] result = begin x = X[begin] y = X[begin+1] z = X[begin+2] end
I get the following tree:
(ERROR ; [0, 0] - [7, 0] (assignment ; [0, 0] - [0, 11] (identifier) ; [0, 0] - [0, 1] (operator) ; [0, 2] - [0, 3] (vector_expression ; [0, 4] - [0, 11] (integer_literal) ; [0, 5] - [0, 6] (integer_literal) ; [0, 7] - [0, 8] (integer_literal))) ; [0, 9] - [0, 10] (identifier) ; [2, 0] - [2, 6] (assignment ; [3, 4] - [3, 16] (identifier) ; [3, 4] - [3, 5] (operator) ; [3, 6] - [3, 7] (index_expression ; [3, 8] - [3, 16] (identifier) ; [3, 8] - [3, 9] (vector_expression ; [3, 9] - [3, 16] (identifier)))) ; [3, 10] - [3, 15] (identifier) ; [4, 4] - [4, 5] (identifier) ; [4, 8] - [4, 9] (matrix_row ; [4, 10] - [4, 15] (identifier)) ; [4, 10] - [4, 15] (ERROR ; [4, 15] - [7, 0] (unary_expression ; [4, 15] - [4, 17] (operator) ; [4, 15] - [4, 16] (integer_literal)) ; [4, 16] - [4, 17] (ERROR) ; [4, 17] - [4, 18] (identifier) ; [5, 4] - [5, 5] (identifier) ; [5, 8] - [5, 9] (compound_statement ; [5, 10] - [6, 3] (unary_expression ; [5, 15] - [5, 17] (operator) ; [5, 15] - [5, 16] (integer_literal)) ; [5, 16] - [5, 17] (ERROR)))) ; [5, 17] - [5, 18]
But not when I invert the order of the elements inside the slicing, for example:
X = [1,2,3] result = begin x = X[begin] y = X[1+begin] z = X[2+begin] end
where I obtain the following tree:
(source_file ; [0, 0] - [7, 0] (assignment ; [0, 0] - [0, 11] (identifier) ; [0, 0] - [0, 1] (operator) ; [0, 2] - [0, 3] (vector_expression ; [0, 4] - [0, 11] (integer_literal) ; [0, 5] - [0, 6] (integer_literal) ; [0, 7] - [0, 8] (integer_literal))) ; [0, 9] - [0, 10] (assignment ; [2, 0] - [6, 3] (identifier) ; [2, 0] - [2, 6] (operator) ; [2, 7] - [2, 8] (compound_statement ; [2, 9] - [6, 3] (assignment ; [3, 4] - [3, 16] (identifier) ; [3, 4] - [3, 5] (operator) ; [3, 6] - [3, 7] (index_expression ; [3, 8] - [3, 16] (identifier) ; [3, 8] - [3, 9] (vector_expression ; [3, 9] - [3, 16] (identifier)))) ; [3, 10] - [3, 15] (assignment ; [4, 4] - [4, 18] (identifier) ; [4, 4] - [4, 5] (operator) ; [4, 6] - [4, 7] (index_expression ; [4, 8] - [4, 18] (identifier) ; [4, 8] - [4, 9] (vector_expression ; [4, 9] - [4, 18] (binary_expression ; [4, 10] - [4, 17] (integer_literal) ; [4, 10] - [4, 11] (operator) ; [4, 11] - [4, 12] (identifier))))) ; [4, 12] - [4, 17] (assignment ; [5, 4] - [5, 18] (identifier) ; [5, 4] - [5, 5] (operator) ; [5, 6] - [5, 7] (index_expression ; [5, 8] - [5, 18] (identifier) ; [5, 8] - [5, 9] (vector_expression ; [5, 9] - [5, 18] (binary_expression ; [5, 10] - [5, 17] (integer_literal) ; [5, 10] - [5, 11] (operator) ; [5, 11] - [5, 12] (identifier)))))))) ; [5, 12] - [5, 17]
This may be related to #127
Yes, it's the same error as 127. I'll close this as a duplicate to not get confused later.
Hi! I am currently seeing the following error whenever I want to parse the following example:
I get the following tree:
But not when I invert the order of the elements inside the slicing, for example:
where I obtain the following tree:
This may be related to #127