Code Monkey home page Code Monkey logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from protobuf-java-format.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from protobuf-java-format.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024

Original comment by eliran.bivas on 3 May 2011 at 1:36

  • Added labels: XmlFormat

from protobuf-java-format.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.