Skip to content

Commit

Permalink
[mwe2] Extension types within code builder are no more ignored.
Browse files Browse the repository at this point in the history
Due to invalid function implementation, the "addExtends" and
"setExtends" functions within the code builders ignored the given
extension types.

see #830

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed May 28, 2018
1 parent 86451bc commit a08fd45
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion formatting-styles/gtk/sarl.lang
Expand Up @@ -24,7 +24,7 @@
limitations under the License.
-->
<!-- Style for SARL 0.7 -->
<!-- Style for SARL 0.8 -->

<language id="sarl" _name="SARL" version="2.0" _section="Source">
<metadata>
Expand Down
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-beamer-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-beamer-listing}[2018/02/15]
\ProvidesPackage{sarl-beamer-listing}[2018/05/28]
\newif\ifusesarlcolors\usesarlcolorstrue
\DeclareOption{sarlcolors}{\global\usesarlcolorstrue}
\DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse}
Expand Down Expand Up @@ -76,7 +76,7 @@
}
\newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\usebeamertemplate{code inline style}]{#1}}\else\lstinline[basicstyle=\usebeamertemplate{code inline style}]{#1}\fi}
\newcommand{\sarl}{\mbox{SARL}\xspace}
\newcommand{\sarlversion}{0.7}
\newcommand{\sarlversion}{0.8}
\ifusesarlcolors
\setbeamercolor*{code keyword}{fg=SARLkeyword}
\setbeamercolor*{code string}{fg=SARLstring}
Expand Down
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-colorized-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-colorized-listing}[2018/02/15]
\ProvidesPackage{sarl-colorized-listing}[2018/05/28]
\newif\ifusesarlcolors\usesarlcolorstrue
\DeclareOption{sarlcolors}{\global\usesarlcolorstrue}
\DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse}
Expand Down Expand Up @@ -81,5 +81,5 @@
}
\newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\normalcolor]{#1}}\else\lstinline[basicstyle=\normalcolor]{#1}\fi}
\newcommand{\sarl}{\mbox{SARL}\xspace}
\newcommand{\sarlversion}{0.7}
\newcommand{\sarlversion}{0.8}
\endinput
4 changes: 2 additions & 2 deletions formatting-styles/latex/sarl-listing.sty
Expand Up @@ -22,7 +22,7 @@
% limitations under the License.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sarl-listing}[2018/02/15]
\ProvidesPackage{sarl-listing}[2018/05/28]
\newif\ifusesarlcolors\usesarlcolorstrue
\DeclareOption{sarlcolors}{\global\usesarlcolorstrue}
\DeclareOption{nosarlcolors}{\global\usesarlcolorsfalse}
Expand Down Expand Up @@ -67,5 +67,5 @@
}
\newcommand{\code}[1]{\ifmmode\text{\lstinline[basicstyle=\normalcolor]{#1}}\else\lstinline[basicstyle=\normalcolor]{#1}\fi}
\newcommand{\sarl}{\mbox{SARL}\xspace}
\newcommand{\sarlversion}{0.7}
\newcommand{\sarlversion}{0.8}
\endinput
2 changes: 1 addition & 1 deletion formatting-styles/prettify/lang-sarl.js
Expand Up @@ -23,7 +23,7 @@
* limitations under the License.
*
*/
/* Style for SARL 0.7 */
/* Style for SARL 0.8 */

PR['registerLangHandler'](
PR['createSimpleLexer'](
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/pygments/sarllexer/__init__.py
Expand Up @@ -22,7 +22,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Style for SARL 0.7
# Style for SARL 0.8


__all__ = [ ]
4 changes: 2 additions & 2 deletions formatting-styles/pygments/sarllexer/sarl.py
Expand Up @@ -22,7 +22,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Style for SARL 0.7
# Style for SARL 0.8


import re
Expand All @@ -34,7 +34,7 @@ class SarlLexer(RegexLexer):
"""
For `SARL <http://www.sarl.io>`_ source code.
.. versionadded:: 0.7
.. versionadded:: 0.8
"""

name = 'SARL'
Expand Down
4 changes: 2 additions & 2 deletions formatting-styles/pygments/setup.py
Expand Up @@ -22,14 +22,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Style for SARL 0.7
# Style for SARL 0.8


from setuptools import setup

setup (
name='sarl.pylexer',
version='0.7',
version='0.8',
packages=['sarl.pylexer'],
entry_points =
"""
Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/source-highlight/sarl.lang
Expand Up @@ -21,7 +21,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Style for SARL 0.7
# Style for SARL 0.8

preproc = "import","package"

Expand Down
2 changes: 1 addition & 1 deletion formatting-styles/vim/ftdetect/sarl.vim
@@ -1,5 +1,5 @@
" Vim filetype-detection file
" Language: SARL
" Version: 0.7
" Version: 0.8

au BufRead,BufNewFile *.sarl set filetype=sarl
2 changes: 1 addition & 1 deletion formatting-styles/vim/syntax/sarl.vim
@@ -1,6 +1,6 @@
" Vim syntax file
" Language: SARL
" Version: 0.7
" Version: 0.8
"
" $Id$
"
Expand Down
Expand Up @@ -1375,10 +1375,12 @@ protected void appendTo(TargetStringConcatenation it) {
it.append(".setExtends(superTypeRef);"); //$NON-NLS-1$
}
it.newLine();
if (!Strings.isEmpty(defaultType) && !isExtendsKeywordFound.get()) {
if (!Strings.isEmpty(defaultType)) {
it.append("\t\t\t\treturn;"); //$NON-NLS-1$
it.newLine();
} else {
it.append("\t\t\treturn;"); //$NON-NLS-1$
}
it.newLine();
if (!Strings.isEmpty(defaultType)) {
it.append("\t\t\t}"); //$NON-NLS-1$
it.newLine();
Expand Down
Expand Up @@ -117,6 +117,7 @@ public void addExtends(String superType) {
JvmTypeReference baseTypeRef = findType(this.sarlCapacity, Capacity.class.getCanonicalName());
if (isSubTypeOf(this.sarlCapacity, superTypeRef, baseTypeRef)) {
this.sarlCapacity.getExtends().add(superTypeRef);
return;
}
}
}
Expand Down
Expand Up @@ -131,6 +131,7 @@ public void setExtends(String superType) {
if (!Strings.isEmpty(superType)) {
JvmParameterizedTypeReference superTypeRef = newTypeRef(this.container, superType);
this.sarlClass.setExtends(superTypeRef);
return;
}
this.sarlClass.setExtends(null);
}
Expand Down
Expand Up @@ -130,6 +130,7 @@ public void addExtends(String superType) {
if (!Strings.isEmpty(superType)) {
JvmParameterizedTypeReference superTypeRef = newTypeRef(this.container, superType);
this.sarlInterface.getExtends().add(superTypeRef);
return;
}
}

Expand Down

0 comments on commit a08fd45

Please sign in to comment.