Comments (7)
[deleted comment]
from protobuf-java-format.
[deleted comment]
from protobuf-java-format.
I've also just found that places like Salt Lake City, UT also do not work.
Original comment by [email protected]
on 4 Mar 2010 at 10:59
from protobuf-java-format.
It became necessary to use a different pattern for values. I've modified
nextToken
to look like this:
public void nextToken(boolean skipWhiteSpace, boolean isValue) {
previousLine = line;
previousColumn = column;
// Advance the line counter to the current position.
while (pos < matcher.regionStart()) {
if (text.charAt(pos) == '\n') {
++line;
column = 0;
}
else {
++column;
}
++pos;
}
// Match the next token.
if (matcher.regionStart() == matcher.regionEnd()) {
// EOF
currentToken = "";
}
else {
if (isValue) {
matcher.usePattern(VALUE_TOKEN);
}
else {
matcher.usePattern(IDENTIFIER_TOKEN);
}
if (matcher.lookingAt()) {
currentToken = matcher.group();
matcher.region(matcher.end(), matcher.regionEnd());
}
else {
if (isValue) {
// there is no content in ths element
currentToken = "";
}
else {
// Take one character.
currentToken = String.valueOf(text.charAt(pos));
matcher.region(pos + 1, matcher.regionEnd());
}
}
if (skipWhiteSpace) {
skipWhitespace();
}
}
}
where VALUE_TOKEN is "[^<>]+";
This is really ugly and isn't a well defined method. I'm leaving it to you guys
to
decide how to handle this. I'd rather refactor this into more specialized
methods.
If I have some more time, I'll see what I can do.
amoffetATgmailDOTcom
Original comment by [email protected]
on 7 Mar 2010 at 4:09
from protobuf-java-format.
This appears to be fixed in the code provided in item 10
Original comment by [email protected]
on 11 Mar 2010 at 6:37
from protobuf-java-format.
I was incorrect. An old maven dependency fooled me. This is still an issue.
Original comment by [email protected]
on 11 Mar 2010 at 11:04
from protobuf-java-format.
Original comment by eliran.bivas
on 3 May 2011 at 1:36
- Added labels: XmlFormat
from protobuf-java-format.
Related Issues (20)
- Target Java 1.5 instead of 1.6
- Common Interface for all formats HOT 5
- Code review request HOT 1
- Tokenizer bug in XmlFormat.merge HOT 1
- Escaped slash is not correctly handled HOT 3
- It just can not work for my test
- Fail for partial build
- Option to omit top-level element wrapping
- JsonFormat.merge does not parse doubles correctly for undefined field HOT 1
- invalid escapes \a and \v in output of byte array HOT 4
- Serializing a builder that has a default value, but doesn't override it, creates json without that value. HOT 1
- com.googlecode.protobuf.format.JsonFormat#escapeBytes handles '\a' incorrectly. '\a' is ivalid value for json. HOT 3
- Feature Request: Some level of Avro Support
- Unknown fields violate JSON syntax HOT 1
- (valid) empty object throws a ParseException HOT 2
- JSON parser does not accept camel-case fieldnames.
- Error while parsing Json string when a non-primitive field is null
- question about UTF8
- JSON formatting breaks when a proto Message contains UnknownFields
- Proto3 enum value 0 does not display
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protobuf-java-format.