From 96d42d833a0b9bc825713165e1eacb72d6a083e5 Mon Sep 17 00:00:00 2001 From: Renata Hodovan Date: Thu, 15 Jun 2017 10:11:44 +0200 Subject: [PATCH 1/2] Use spaces consistently to indent the generated Python code. --- .../templates/codegen/Python2/Python2.stg | 24 +++++++++---------- .../templates/codegen/Python3/Python3.stg | 24 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Python2/Python2.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Python2/Python2.stg index d4820ddb0..b01a76fc4 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Python2/Python2.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Python2/Python2.stg @@ -167,16 +167,16 @@ class ( Parser ): dumpActions(recog, argFuncs, actionFuncs, sempredFuncs) ::= << def action(self, localctx, ruleIndex, actionIndex): - if self._actions is None: - actions = dict() + if self._actions is None: + actions = dict() ] = self._action }; separator="\n"> - self._actions = actions - action = self._actions.get(ruleIndex, None) - if action is not None: - action(localctx, actionIndex) - else: - raise Exception("No registered action for:" + str(ruleIndex)) + actions[] = self._action }; separator="\n"> + self._actions = actions + action = self._actions.get(ruleIndex, None) + if action is not None: + action(localctx, actionIndex) + else: + raise Exception("No registered action for:" + str(ruleIndex)) @@ -518,7 +518,7 @@ if not : ExceptionClause(e, catchArg, catchAction) ::= << catch () { - + } >> @@ -623,7 +623,7 @@ def (self, i=None): LexerRuleContext() ::= "RuleContext" /** The rule context name is the rule followed by a suffix; e.g., - * r becomes rContext. + * r becomes rContext. */ RuleContextNameSuffix() ::= "Context" @@ -806,7 +806,7 @@ def serializedATN(): >> /** Using a type to init value map, try to init a type; if not in table - * must be an object, default value is "null". + * must be an object, default value is "null". */ initValue(typeName) ::= << diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg index 782b4f9ed..081e3f3f1 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg @@ -176,16 +176,16 @@ class ( Parser ): dumpActions(recog, argFuncs, actionFuncs, sempredFuncs) ::= << def action(self, localctx:RuleContext, ruleIndex:int, actionIndex:int): - if self._actions is None: - actions = dict() + if self._actions is None: + actions = dict() ] = self._action }; separator="\n"> - self._actions = actions - action = self._actions.get(ruleIndex, None) - if action is not None: - action(localctx, actionIndex) - else: - raise Exception("No registered action for:" + str(ruleIndex)) + actions[] = self._action }; separator="\n"> + self._actions = actions + action = self._actions.get(ruleIndex, None) + if action is not None: + action(localctx, actionIndex) + else: + raise Exception("No registered action for:" + str(ruleIndex)) @@ -527,7 +527,7 @@ if not : ExceptionClause(e, catchArg, catchAction) ::= << catch () { - + } >> @@ -632,7 +632,7 @@ def (self, i:int=None): LexerRuleContext() ::= "RuleContext" /** The rule context name is the rule followed by a suffix; e.g., - * r becomes rContext. + * r becomes rContext. */ RuleContextNameSuffix() ::= "Context" @@ -813,7 +813,7 @@ def serializedATN(): >> /** Using a type to init value map, try to init a type; if not in table - * must be an object, default value is "null". + * must be an object, default value is "null". */ initValue(typeName) ::= << From ceaf085dc559fbe3c05e7409fb006fd2085b65c4 Mon Sep 17 00:00:00 2001 From: Dong Xie Date: Mon, 26 Jun 2017 13:18:48 +0100 Subject: [PATCH 2/2] [dotnet] for linux target, bring up to jdk8 since jdk7 no longer available for Trusty; for linux and osx targets, bring up dotnet from 1.0.3 to 1.0.4; Trusty image now has mvn 3.3.9 builtin, removed install code --- .travis.yml | 2 +- .travis/before-install-linux-dotnet.sh | 13 +------------ .travis/before-install-osx-dotnet.sh | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e6f65cce..812eca9b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ matrix: jdk: oraclejdk7 env: TARGET=csharp - os: linux - jdk: oraclejdk7 + jdk: oraclejdk8 dist: trusty env: TARGET=dotnet - os: linux diff --git a/.travis/before-install-linux-dotnet.sh b/.travis/before-install-linux-dotnet.sh index 869d3650d..bfe4eff76 100755 --- a/.travis/before-install-linux-dotnet.sh +++ b/.travis/before-install-linux-dotnet.sh @@ -6,16 +6,5 @@ set -euo pipefail sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 sudo apt-get update -sudo apt-get install dotnet-dev-1.0.3 - -# install mvn -wget http://apache.mirrors.lucidnetworks.net/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz && \ - wget https://www.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz.md5 && \ - echo "$(cat apache-maven-3.3.9-bin.tar.gz.md5) apache-maven-3.3.9-bin.tar.gz" > apache-maven-3.3.9-bin.tar.gz.md5 && \ - md5sum -c *.md5 - -sudo rm -rf /usr/local/maven/ && sudo mkdir -p /usr/local/maven && \ - sudo tar xzvf apache-maven-3.3.9-bin.tar.gz -C /usr/local/maven --strip-components=1 - -mvn -v +sudo apt-get install dotnet-dev-1.0.4 diff --git a/.travis/before-install-osx-dotnet.sh b/.travis/before-install-osx-dotnet.sh index fa67f5d67..428016fa6 100755 --- a/.travis/before-install-osx-dotnet.sh +++ b/.travis/before-install-osx-dotnet.sh @@ -12,10 +12,10 @@ ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/ # download dotnet core -curl https://download.microsoft.com/download/1/1/4/114223DE-0AD6-4B8A-A8FB-164E5862AF6E/dotnet-dev-osx-x64.1.0.3.pkg -o /tmp/dotnet-dev-osx-x64.1.0.3.pkg +curl https://download.microsoft.com/download/B/9/F/B9F1AF57-C14A-4670-9973-CDF47209B5BF/dotnet-dev-osx-x64.1.0.4.pkg -o /tmp/dotnet-dev-osx-x64.1.0.4.pkg # install dotnet core -sudo installer -pkg /tmp/dotnet-dev-osx-x64.1.0.3.pkg -target / +sudo installer -pkg /tmp/dotnet-dev-osx-x64.1.0.4.pkg -target / # make the link ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/