문제

I guess the titles says it all. In my program I have a bunch of loc's and I would like to extract the line numbers / column numbers from them.

Is there a way to do this?

도움이 되었습니까?

해결책

rascal>myLoc = |project://HelloWorld/src/ByeWorld.java|(24,669,<3,0>,<45,1>);
loc: |project://HelloWorld/src/ByeWorld.java|(24,669,<3,0>,<45,1>)

rascal>myLoc.begin
tuple[int line,int column]: <3,0>

rascal>myLoc.begin.line
int: 3

rascal>myLoc.begin.column
int: 0

See also: http://tutor.rascal-mpl.org/Rascal/Expressions/Values/Location/Location.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top