Automated merge with https://hg.netbeans.org/main/contrib
authorJulien Enselme <jenselme@netbeans.org>
Tue, 26 May 2015 23:08:37 +0200
changeset 1827448c1672ec771
parent 18272 c84169e0a73e
parent 18273 7268510f9338
child 18275 776d88bb7647
Automated merge with https://hg.netbeans.org/main/contrib
     1.1 --- a/o.jython/external/binaries-list	Mon May 25 12:35:38 2015 +0200
     1.2 +++ b/o.jython/external/binaries-list	Tue May 26 23:08:37 2015 +0200
     1.3 @@ -1,1 +1,1 @@
     1.4 -D7EDD317672FC19D95042325098EC2868EB60EFE jython-parser.jar
     1.5 +7747A693D0B49F4AED0E5C296385A0807679B37D jython-parser.jar
     2.1 --- a/o.jython/external/update_jython.sh	Mon May 25 12:35:38 2015 +0200
     2.2 +++ b/o.jython/external/update_jython.sh	Tue May 26 23:08:37 2015 +0200
     2.3 @@ -1,24 +1,6 @@
     2.4  #!/bin/sh
     2.5  
     2.6 -#
     2.7 -# jython-parser.jar is updated from the jython sources. In theory, you could
     2.8 -# just use the standard Jython trunk or particular build - run the developer-build
     2.9 -# target and then copy out the resulting jython-dev
    2.10 -# jar. However, Jython currently only supports 2.5 - and chokes on 2.6 constructs.
    2.11 -# To avoid NetBeans not being able to even index a 2.6 installation, Frank has
    2.12 -# provided a port which contains a 2.6 grammar. We're using that one for IDE
    2.13 -# parsing - and a more standard 2.5 build for execution.
    2.14 -#
    2.15 -# Run this script to update the jython.jar when applicable.
    2.16 -#
    2.17 -
    2.18 -
    2.19 -# Location to fetch Jython sources from:
    2.20 -#repository=https://jython.svn.sourceforge.net/svnroot/jython/tags/Release_2_5beta0/jython
    2.21 -#repository=https://jython.svn.sourceforge.net/svnroot/jython/trunk/jython
    2.22 -#repository=https://jython.svn.sourceforge.net/svnroot/jython/trunk/sandbox/wierzbicki/grammar26
    2.23 -#repository=https://jython.svn.sourceforge.net/svnroot/jython/tags/Release_2_5rc2/jython
    2.24 -repository=https://jython.svn.sourceforge.net/svnroot/jython/branches/jy26
    2.25 +repository=https://bitbucket.org/jython/jython
    2.26  
    2.27  # Name of jar file we're creating from the jython.jar
    2.28  target=jython-parser.jar
    2.29 @@ -26,20 +8,23 @@
    2.30  # Temp build location
    2.31  location=tmp
    2.32  
    2.33 +echo "fetching sources"
    2.34  rm -rf "$location"
    2.35 -echo "Svn checkout from $repository to $location"
    2.36 -svn export "$repository" "$location"
    2.37 +hg clone "$repository" "$location"
    2.38  cd "$location"
    2.39 -echo "Applying Frank's patch to update $location/src/org/python/core/util/FileUtil.java"
    2.40 -patch -p0 < isatty.diff
    2.41 -echo "Building bits"
    2.42 +
    2.43 +# Note - need both ant calls
    2.44 +echo "Building jar"
    2.45 +ant
    2.46  ant jar-complete
    2.47 -#cp dist/jython-dev.jar ../$target
    2.48 -cp dist/jython.jar ../$target
    2.49 +
    2.50  cd ..
    2.51 +mv "$location"/dist/jython.jar "$target"
    2.52 +
    2.53  echo "Updating binaries-list"
    2.54 -echo `openssl dgst -sha1 $target | awk '{ print toupper($2) }'` $target > binaries-list
    2.55 +echo $(openssl dgst -sha1 "$target" | awk '{ print toupper($2) }') "$target" > binaries-list
    2.56 +
    2.57  echo "Cleaning up"
    2.58 -#rm -rf "$location"
    2.59 +rm -rf "$location"
    2.60 +
    2.61  echo "Done."
    2.62 -
     3.1 --- a/python.editor/src/org/netbeans/modules/python/editor/PythonParser.java	Mon May 25 12:35:38 2015 +0200
     3.2 +++ b/python.editor/src/org/netbeans/modules/python/editor/PythonParser.java	Tue May 26 23:08:37 2015 +0200
     3.3 @@ -60,7 +60,6 @@
     3.4  
     3.5  import org.openide.filesystems.FileUtil;
     3.6  import org.openide.util.Exceptions;
     3.7 -import org.python.antlr.BaseParser;
     3.8  import org.python.antlr.ListErrorHandler;
     3.9  import org.python.antlr.ParseException;
    3.10  import org.python.antlr.PythonLexer;
    3.11 @@ -93,7 +92,7 @@
    3.12      public mod file_input(CharStream charStream, String fileName) throws RecognitionException {
    3.13          ListErrorHandler eh = new ListErrorHandler();
    3.14          mod tree = null;
    3.15 -        PythonLexer lexer = new BaseParser.PyLexer(charStream);
    3.16 +        PythonLexer lexer = new PythonLexer(charStream);
    3.17          lexer.setErrorHandler(eh);
    3.18          CommonTokenStream tokens = new CommonTokenStream(lexer);
    3.19          tokens.discardOffChannelTokens(true);
    3.20 @@ -289,12 +288,20 @@
    3.21  
    3.22                          errors.add(new DefaultError(null, message, null, file, start, end, Severity.ERROR));
    3.23  
    3.24 +                        br = new BaseRecognizer() {
    3.25 +
    3.26 +                            @Override
    3.27 +                            public String getSourceName() {
    3.28 +                                return file.getName();
    3.29 +                            }
    3.30 +                        };
    3.31 +
    3.32                          super.reportError(br, re);
    3.33                      }
    3.34                  }
    3.35              };
    3.36  
    3.37 -            PythonLexer lexer = new BaseParser.PyLexer(new ANTLRStringStream(sourceCode));
    3.38 +            PythonLexer lexer = new PythonLexer(new ANTLRStringStream(sourceCode));
    3.39              lexer.setErrorHandler(errorHandler);
    3.40              CommonTokenStream tokens = new CommonTokenStream(lexer);
    3.41              tokens.discardOffChannelTokens(true);