2017-05-22 3 views

답변

0

Github의 master 분기 버전에는 아직 공식 출시되지 않았지만 AST 노드의 coord 속성에 열이 포함되어 있습니다.

showcoord=True으로 줄의 주석을 제거하면이 예가 실제로 적용될 수 있습니다. 여기 덤프 AST 단편이다 :

FileAST: (at None) 
    Typedef: Node, [], ['typedef'] (at <none>:2:17) 
    TypeDecl: Node, [] (at <none>:2:17) 
     IdentifierType: ['int'] (at <none>:2:13) 
    Typedef: Hash, [], ['typedef'] (at <none>:2:23) 
    TypeDecl: Hash, [] (at <none>:2:23) 
     IdentifierType: ['int'] (at <none>:2:13) 
    FuncDef: (at <none>:4:10) 
    Decl: HashPrint, [], [], [] (at <none>:4:10) 
     FuncDecl: (at <none>:4:10) 
     ParamList: (at <none>:4:24) 
      Decl: hash, [], [], [] (at <none>:4:24) 
      PtrDecl: [] (at <none>:4:24) 
       TypeDecl: hash, [] (at <none>:4:26) 

(at <none>:2:17) 부분 "파일 <none>, 행 2 열 17"수단 (예 단순한 문자열 해석되기 때문에 파일 <none>이다).