private void updateTokenPositionAndValue(ParseNode node) { TextLocation location = input.getLocation(node.getStartIndex()); if (location == null) { tokenBuilder.setGeneratedCode(true); // Godin: line, column and uri has no value for generated code, but we should bypass checks in TokenBuilder tokenBuilder.setLine(1); tokenBuilder.setColumn(0); tokenBuilder.setURI(FAKE_URI); } else { tokenBuilder.setGeneratedCode(false); tokenBuilder.setLine(location.getLine()); tokenBuilder.setColumn(location.getColumn() - 1); tokenBuilder.setURI(location.getFileURI() == null ? FAKE_URI : location.getFileURI()); TextLocation copyLocation = input instanceof CompositeTextCharSequence ? ((CompositeTextCharSequence) input).getCopyLocation(node.getStartIndex()) : null; if (copyLocation == null) { tokenBuilder.notCopyBook(); } else { tokenBuilder.setCopyBook(copyLocation.getFile().getAbsolutePath(), copyLocation.getLine()); } } String value = getValue(node); tokenBuilder.setValueAndOriginalValue(value); }
private void updateTokenPositionAndValue(ParseNode node) { TextLocation location = input.getLocation(node.getStartIndex()); if (location == null) { tokenBuilder.setGeneratedCode(true); // Godin: line, column and uri has no value for generated code, but we should bypass checks in TokenBuilder tokenBuilder.setLine(1); tokenBuilder.setColumn(0); tokenBuilder.setURI(FAKE_URI); } else { tokenBuilder.setGeneratedCode(false); tokenBuilder.setLine(location.getLine()); tokenBuilder.setColumn(location.getColumn() - 1); tokenBuilder.setURI(location.getFileURI() == null ? FAKE_URI : location.getFileURI()); tokenBuilder.notCopyBook(); } String value = getValue(node); tokenBuilder.setValueAndOriginalValue(value); }
private void updateTokenPositionAndValue(ParseNode node) { TextLocation location = input.getLocation(node.getStartIndex()); if (location == null) { tokenBuilder.setGeneratedCode(true); // Godin: line, column and uri has no value for generated code, but we should bypass checks in TokenBuilder tokenBuilder.setLine(1); tokenBuilder.setColumn(0); tokenBuilder.setURI(FAKE_URI); } else { tokenBuilder.setGeneratedCode(false); tokenBuilder.setLine(location.getLine()); tokenBuilder.setColumn(location.getColumn() - 1); tokenBuilder.setURI(location.getFileURI() == null ? FAKE_URI : location.getFileURI()); tokenBuilder.notCopyBook(); } String value = getValue(node); tokenBuilder.setValueAndOriginalValue(value); }