@@ -1068,7 +1068,8 @@ defmodule Code do
10681068 Macro arguments are typically transformed by unquoting them into the
10691069 returned quoted expressions (instead of evaluated).
10701070
1071- See `eval_string/3` for a description of `binding` and `opts`.
1071+ See `eval_string/3` for a description of arguments and return types.
1072+ The options are described under `env_for_eval/1`.
10721073
10731074 ## Examples
10741075
@@ -1168,6 +1169,10 @@ defmodule Code do
11681169 * `:column` - (since v1.11.0) the starting column of the string being parsed.
11691170 Defaults to 1.
11701171
1172+ * `:indentation` - (since v1.19.0) the indentation for the string being parsed.
1173+ This is useful when the code parsed is embedded within another document.
1174+ Defaults to 0.
1175+
11711176 * `:columns` - when `true`, attach a `:column` key to the quoted
11721177 metadata. Defaults to `false`.
11731178
@@ -1360,13 +1365,11 @@ defmodule Code do
13601365 { forms , comments }
13611366
13621367 { :error , { location , error , token } } ->
1363- :elixir_errors . parse_error (
1364- location ,
1365- Keyword . get ( opts , :file , "nofile" ) ,
1366- error ,
1367- token ,
1368- { charlist , Keyword . get ( opts , :line , 1 ) , Keyword . get ( opts , :column , 1 ) }
1369- )
1368+ file = Keyword . get ( opts , :file , "nofile" )
1369+ line = Keyword . get ( opts , :line , 1 )
1370+ column = Keyword . get ( opts , :column , 1 )
1371+ input = { charlist , line , column , Keyword . get ( opts , :indentation , 0 ) }
1372+ :elixir_errors . parse_error ( location , file , error , token , input )
13701373 end
13711374 end
13721375
0 commit comments