Closed arnoudbuzing closed 4 years ago
The allowed values are "LineColumn"
or "SourceCharacterIndex"
. I do not see there being more.
"LineColumn"
returns Source
metadata in {{line1, col1}, {line2, col2}}
format:
In[6]:= CodeConcreteParse["a+b", "SourceConvention" -> "LineColumn"]
Out[6]= ContainerNode[String, {InfixNode[
Plus, {LeafNode[Symbol, "a", <|Source -> {{1, 1}, {1, 2}}|>],
LeafNode[Token`Plus, "+", <|Source -> {{1, 2}, {1, 3}}|>],
LeafNode[Symbol,
"b", <|Source -> {{1, 3}, {1, 4}}|>]}, <|Source -> {{1, 1}, {1,
4}}|>]}, <||>]
"SourceCharacterIndex"
returns Source
metadata in StringTake-spec
format:
In[7]:= CodeConcreteParse["a+b",
"SourceConvention" -> "SourceCharacterIndex"]
Out[7]= ContainerNode[String, {InfixNode[
Plus, {LeafNode[Symbol, "a", <|Source -> {1, 1}|>],
LeafNode[Token`Plus, "+", <|Source -> {2, 2}|>],
LeafNode[Symbol,
"b", <|Source -> {3, 3}|>]}, <|Source -> {1, 3}|>]}, <||>]
I have tried "ColumnLine" as a RHS, but that does not seem to work:
Are there option values here other that "LineColumn" ?