mulang 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5f2532a78fd09450660accc92e937121b5b10cfb3e72abebd27182fadd52eea
4
- data.tar.gz: 9673dafb8b5643b692649116dcb816ef068128c917c54923a54dc19db2a98268
3
+ metadata.gz: 6c4b91159deb396c27d53a9a9a1399599fb27ed62a8dd8c066520db026b70dba
4
+ data.tar.gz: 55197a5e6936e8dece7b4698d49be7458a5bf7794b2f0148bedc7dd043400362
5
5
  SHA512:
6
- metadata.gz: 43ac61e3aacf5d5caef6ac737c4d99cfd512007dae3d8effd7e6a8ad73b01281717bcb660a0d0fb6c5fa37d4c30753b6da7d48a5aae12f07f0fb98f9bac52639
7
- data.tar.gz: 735ec1621b40a3241120274b920e6d28cac2c8e1045a3afdb9b6466f0cc9ea3efe81b3251ffb894814b1a330d6340ac6f0b1a09eb7a5d34c6a0bd23ce0c7f1c1
6
+ metadata.gz: 4d043f51ed7c3faa12973648c44fd10f804270eaef97e8bdd457817bab25370ca17e7a9fab4cea57832f581b5181dbe59b4f72fb6a2772cd14581f3cc0236ffd
7
+ data.tar.gz: 5bfbb6977a62ab53824703e854ed0022fbcdee91e7ffb8e588d805dd3ab328b62ab63b3fa0169463c988277a4d8d9fde23bb9c7a203c9b11169a69fc6804ad95
data/bin/mulang CHANGED
Binary file
@@ -6,7 +6,7 @@ en:
6
6
  must: must
7
7
  solution: solution
8
8
  with_char: ' with character <i>%{value}</i>'
9
- with_false: ' with value <i>%{keyword_false}</i>'
9
+ with_false: ' with value <i>%{keyword_False}</i>'
10
10
  with_literal: ' with a literal value'
11
11
  with_logic: ' with a boolean expression'
12
12
  with_math: ' with a math expression'
@@ -15,7 +15,7 @@ en:
15
15
  with_number: ' with number <i>%{value}</i>'
16
16
  with_string: ' with string <i>%{value}</i>'
17
17
  with_symbol: ' with symbol <i>%{value}</i>'
18
- with_true: ' with value <i>%{keyword_true}</i>'
18
+ with_true: ' with value <i>%{keyword_True}</i>'
19
19
  inspection:
20
20
  Assigns_except: '%{binding} %{must} assign something distinct from %{target}%{matching}'
21
21
  Assigns_like: '%{binding} %{must} assign something similar to %{target}%{matching}'
@@ -47,7 +47,7 @@ en:
47
47
  DeclaresComputationWithArity3_named: '%{target} %{must} have 3 parameters'
48
48
  DeclaresComputationWithArity4_named: '%{target} %{must} have 4 parameters'
49
49
  DeclaresComputationWithArity5_named: '%{target} %{must} have 5 parameters'
50
- DeclaresEntryPoint: '%{binding} %{must} declare an entry point%{matching}'
50
+ DeclaresEntryPoint: '%{binding} %{must} declare a <i>%{keyword_EntryPoint}</i>%{matching}'
51
51
  DeclaresEnumeration_except: '%{binding} %{must} declare enumerations distinct from %{target}'
52
52
  DeclaresEnumeration_like: '%{binding} %{must} declare an enumeration like %{target}'
53
53
  DeclaresEnumeration_named: '%{binding} %{must} declare an enumeration %{target}'
@@ -97,30 +97,34 @@ en:
97
97
  DeclaresVariable_like: '%{binding} %{must} declare a variable similar to %{target}%{matching}'
98
98
  DeclaresVariable_named: '%{binding} %{must} declare a variable %{target}%{matching}'
99
99
  DeclaresVariable: '%{binding} %{must} debe declare variables%{matching}'
100
+ Delegates: '%{binding} %{must} delegate'
100
101
  DiscardsExceptions: '%{binding} is ignoring exceptions silently'
101
102
  DoesConsolePrint: '%{binding} is printing to the console'
102
- DoesNilTest: '%{binding} does <i>%{keyword_null}</i> tests'
103
- DoesNullTest: '%{binding} does <i>%{keyword_null}</i> tests'
103
+ DoesNilTest: '%{binding} does <i>%{keyword_Null}</i> tests'
104
+ DoesNullTest: '%{binding} does <i>%{keyword_Null}</i> tests'
104
105
  DoesTypeTest: '%{binding} string type tests'
105
- HasAssignmentReturn: '%{binding} returns the result of an assignment'
106
+ HasAssignmentCondition: '%{binding} evaluates the result of an assignment where a boolean expression is expected. Perhaps you meant to use the <i>%{operator_Equal}</i> operator?'
107
+ HasAssignmentReturn: '%{binding} returns the result of an assignment. Perhaps you meant to use the <i>%{operator_Equal}</i> operator?'
106
108
  HasCodeDuplication: '%{binding} has code duplication'
107
- HasEmptyIfBranches: '%{binding} has empty <i>%{keyword_if}</i> branches'
108
- HasEmptyRepeat: '%{binding} has empty <i>%{keyword_repeat}</i>'
109
+ HasDeclarationTypos_named: 'Solution must declare %{target}, but declares %{binding}. Perhaps you meant %{target}?'
110
+ HasEmptyIfBranches: '%{binding} has empty <i>%{keyword_If}</i> branches'
111
+ HasEmptyRepeat: '%{binding} has empty <i>%{keyword_Repeat}</i>'
109
112
  HasLongParameterList: '%{binding} has too many parameters. You may be missing an abstraction.'
110
113
  HasMisspelledBindings: '%{binding} is misspelled'
111
114
  HasMisspelledIdentifiers: '%{binding} is misspelled'
112
115
  HasRedundantBooleanComparison: '%{binding} makes unnecesary boolean comparisons'
113
116
  HasRedundantGuards: '%{binding} has unnecessary guards'
114
- HasRedundantIf: '%{binding} has unnecessary <i>%{keyword_if}</i>s'
117
+ HasRedundantIf: '%{binding} has unnecessary <i>%{keyword_If}</i>s'
115
118
  HasRedundantLambda: '%{binding} has unnecessary lambdas'
116
119
  HasRedundantLocalVariableReturn: '%{binding} has unnecesary local variables; please try returning the expression directly'
117
120
  HasRedundantParameter: '%{binding} has unnecessary parameters, that can be removed using point-free'
118
- HasRedundantReduction: '%{binding} uses <i>%{keyword_is}</i>, but it does not artihmetic'
119
- HasRedundantRepeat: '%{binding} has an unnecesary <i>%{keyword_repeat}</i>'
121
+ HasRedundantReduction: '%{binding} uses <i>%{keyword_Is}</i>, but it does not artihmetic'
122
+ HasRedundantRepeat: '%{binding} has an unnecesary <i>%{keyword_Repeat}</i>'
120
123
  HasTooManyMethods: '%{binding} has too many methods'
121
124
  HasTooShortBindings: '%{binding} is a too short identifier'
122
125
  HasTooShortIdentifiers: '%{binding} is a too short identifier'
123
126
  HasUnreachableCode: '%{binding} has unreachable code'
127
+ HasUsageTypos_named: 'Solution must use %{target}, but it uses %{binding}. Perhaps you meant %{target}?'
124
128
  HasWrongCaseBindings: '%{binding} does not honor case conventions'
125
129
  HasWrongCaseIdentifiers: '%{binding} does not honor case conventions'
126
130
  Implements_except: '%{binding} %{must} implement interfaces distinct from %{target}'
@@ -142,9 +146,11 @@ en:
142
146
  Raises_named: '%{binding} %{must} throw %{target}'
143
147
  Raises: '%{binding} %{must} throw exceptions'
144
148
  Returns: '%{binding} %{must} return%{matching}'
145
- ReturnsNil: '%{binding} retuns <i>%{keyword_null}</i>, which is a bad practice'
146
- ReturnsNull: '%{binding} retuns <i>%{keyword_null}</i>, which is a bad practice'
147
- ShouldInvertIfCondition: '%{binding} should invert <i>%{keyword_if}</i> condition and swap branches'
149
+ ReturnsNil: '%{binding} retuns <i>%{keyword_Null}</i>, which is a bad practice'
150
+ ReturnsNull: '%{binding} retuns <i>%{keyword_Null}</i>, which is a bad practice'
151
+ ShouldInvertIfCondition: '%{binding} should invert <i>%{keyword_If}</i> condition and swap branches'
152
+ SubordinatesDeclarationsTo: 'All declarations in %{binding} %{must} be used from %{target}'
153
+ SubordinatesDeclarationsToEntryPoint: 'All declarations in %{binding} %{must} be used from <i>%{keyword_EntryPoint}</i> '
148
154
  TypesAs_named: '%{binding} %{must} type as %{target}'
149
155
  TypesAs: '%{binding} %{must} type'
150
156
  TypesParameterAs_except: '%{binding} %{must} type parameters with a type distinct from %{target}'
@@ -157,33 +163,56 @@ en:
157
163
  Uses_like: '%{binding} %{must} delegate to something similar to %{target}'
158
164
  Uses_named: '%{binding} %{must} use %{target}'
159
165
  Uses: '%{binding} %{must} delegate'
166
+ UsesAnd: '%{binding} %{must} use <i>%{operator_And}</i>'
160
167
  UsesAnonymousVariable: '%{binding} %{must} use an annonymous variable'
168
+ UsesBackwardComposition: '%{binding} %{must} use <i>%{operator_BackwardComposition}</i>'
169
+ UsesBitwiseAnd: '%{binding} %{must} use <i>%{operator_BitwiseAnd}</i>'
170
+ UsesBitwiseLeftShift: '%{binding} %{must} use <i>%{operator_BitwiseLeftShift}</i>'
171
+ UsesBitwiseOr: '%{binding} %{must} use <i>%{operator_BitwiseOr}</i>'
172
+ UsesBitwiseRightShift: '%{binding} %{must} use <i>%{operator_BitwiseRightShift}</i>'
173
+ UsesBitwiseXor: '%{binding} %{must} use <i>%{operator_BitwiseXor}</i>'
161
174
  UsesComposition: '%{binding} %{must} use composition'
162
175
  UsesComprehension: '%{binding} %{must} use comprehensions'
163
176
  UsesConditional: '%{binding} %{must} use conditionals'
164
177
  UsesCut: '%{binding} uses <i>!</li> operator, which is a bad practice'
178
+ UsesDivide: '%{binding} %{must} use <i>%{operator_Divide}</i>'
165
179
  UsesDyamicPolymorphism: '%{binding} %{must} use polymorphism'
166
180
  UsesDynamicMethodOverload: '%{binding} %{must} use overload'
167
- UsesFail: '%{binding} uses <i>%{keyword_fail}</li>, which is a bad practice'
181
+ UsesEqual: '%{binding} %{must} use <i>%{operator_Equal}</i>'
182
+ UsesFail: '%{binding} uses <i>%{keyword_Fail}</li>, which is a bad practice'
168
183
  UsesFindall: '%{binding} %{must} use <i>%{keyword_findall}</i>'
169
- UsesForall: '%{binding} %{must} use <i>%{keyword_forall}</i>'
170
- UsesForeach: '%{binding} %{must} use <i>%{keyword_foreach}</i>%{matching}'
171
- UsesForLoop: '%{binding} %{must} use <i>%{keyword_for}</i>%{matching}'
184
+ UsesForall: '%{binding} %{must} use <i>%{keyword_Forall}</i>'
185
+ UsesForeach: '%{binding} %{must} use <i>%{keyword_Foreach}</i>%{matching}'
186
+ UsesForLoop: '%{binding} %{must} use <i>%{keyword_For}</i>%{matching}'
187
+ UsesForwardComposition: '%{binding} %{must} use <i>%{operator_ForwardComposition}</i>'
188
+ UsesGreatherOrEqualThan: '%{binding} %{must} use <i>%{operator_GreatherOrEqualThan}</i>'
189
+ UsesGreatherThan: '%{binding} %{must} use <i>%{operator_GreatherThan}</i>'
172
190
  UsesGuards: '%{binding} %{must} use guards%{matching}'
173
- UsesIf: '%{binding} %{must} use <i>%{keyword_if}</i>%{matching}'
191
+ UsesHash: '%{binding} %{must} use <i>%{operator_Hash}</i>'
192
+ UsesIf: '%{binding} %{must} use <i>%{keyword_If}</i>%{matching}'
174
193
  UsesLambda: '%{binding} %{must} use lambda expressions%{matching}'
175
- UsesLogic: '%{binding} %{must} usar boolean expressions'
194
+ UsesLessOrEqualThan: '%{binding} %{must} use <i>%{operator_LessOrEqualThan}</i>'
195
+ UsesLessThan: '%{binding} %{must} use <i>%{operator_LessThan}</i>'
196
+ UsesLogic: '%{binding} %{must} usar boolean operators'
176
197
  UsesLoop: '%{binding} %{must} use a loop%{matching}'
177
198
  UsesMath: '%{binding} %{must} usar math expressions'
199
+ UsesMinus: '%{binding} %{must} use <i>%{operator_Minus}</i>'
178
200
  UsesMixin: '%{binding} %{must} use mixins'
201
+ UsesModulo: '%{binding} %{must} use <i>%{operator_Modulo}</i>'
202
+ UsesMultiply: '%{binding} %{must} use <i>%{operator_Multiply}</i>'
203
+ UsesNegation: '%{binding} %{must} use <i>%{operator_Negation}</i>'
179
204
  UsesNot: '%{binding} %{must} use not'
205
+ UsesNotEqual: '%{binding} %{must} use <i>%{operator_NotEqual}</i>'
180
206
  UsesObjectComposition: '%{binding} %{must} use composition'
207
+ UsesOr: '%{binding} %{must} use <i>%{operator_Or}</i>'
208
+ UsesOtherwise: '%{binding} %{must} use <i>%{operator_Otherwise}</i>'
181
209
  UsesPatternMatching: '%{binding} %{must} use pattern matching'
182
- UsesRepeat: '%{binding} %{must} use <i>%{keyword_repeat}</i>%{matching}'
183
- UsesRepeatOf: '%{binding} %{must} use <i>%{keyword_repeat}</i>'
210
+ UsesPlus: '%{binding} %{must} use <i>%{operator_Plus}</i>'
211
+ UsesRepeat: '%{binding} %{must} use <i>%{keyword_Repeat}</i>%{matching}'
212
+ UsesRepeatOf: '%{binding} %{must} use <i>%{keyword_Repeat}</i>'
184
213
  UsesStaticMethodOverload: '%{binding} %{must} use overload'
185
214
  UsesStaticPolymorphism: '%{binding} %{must} use polymorphism'
186
- UsesSwitch: '%{binding} %{must} use a <i>%{keyword_switch}</i>'
215
+ UsesSwitch: '%{binding} %{must} use a <i>%{keyword_Switch}</i>'
187
216
  UsesTemplateMethod: '%{binding} %{must} use a template method'
188
217
  UsesUnificationOperator: '%{binding} uses the unification operator (=)'
189
- UsesWhile: '%{binding} %{must} use <i>%{keyword_while}</i>%{matching}'
218
+ UsesWhile: '%{binding} %{must} use <i>%{keyword_While}</i>%{matching}'
@@ -6,7 +6,7 @@ es:
6
6
  must: debe
7
7
  solution: la solución
8
8
  with_char: ' con el carácter <i>%{value}</i>'
9
- with_false: ' con el valor <i>%{keyword_false}</i>'
9
+ with_false: ' con el valor <i>%{keyword_False}</i>'
10
10
  with_literal: ' con un valor literal'
11
11
  with_logic: ' con una expresión booleana'
12
12
  with_math: 'con una expresión matemática'
@@ -15,7 +15,7 @@ es:
15
15
  with_number: ' con el número <i>%{value}</i>'
16
16
  with_string: ' con la cadena <i>%{value}</i>'
17
17
  with_symbol: ' con el símbolo <i>%{value}</i>'
18
- with_true: ' con el valor <i>%{keyword_true}</i>'
18
+ with_true: ' con el valor <i>%{keyword_True}</i>'
19
19
  inspection:
20
20
  Assigns_except: '%{binding} %{must} asignar a algo diferente a %{target}%{matching}'
21
21
  Assigns_like: '%{binding} %{must} asignar algo parecido a %{target}%{matching}'
@@ -47,7 +47,7 @@ es:
47
47
  DeclaresComputationWithArity3_named: '%{target} %{must} tener tres parámetros'
48
48
  DeclaresComputationWithArity4_named: '%{target} %{must} tener cuatro parámetros'
49
49
  DeclaresComputationWithArity5_named: '%{target} %{must} tener cinco parámetros'
50
- DeclaresEntryPoint: '%{binding} %{must} declarar un punto de entrada%{matching}'
50
+ DeclaresEntryPoint: '%{binding} %{must} declarar un <i>%{keyword_EntryPoint}</i>%{matching}'
51
51
  DeclaresEnumeration_except: '%{binding} %{must} declarar enumeraciones que no se llamen %{target}'
52
52
  DeclaresEnumeration_like: '%{binding} %{must} declarar una enumeracion de nombre parecido a %{target}'
53
53
  DeclaresEnumeration_named: '%{binding} %{must} declarar una enumeracion %{target}'
@@ -101,15 +101,18 @@ es:
101
101
  DeclaresVariable_like: '%{binding} %{must} declarar una variable parecida a %{target}%{matching}'
102
102
  DeclaresVariable_named: '%{binding} %{must} declarar una variable %{target}%{matching}'
103
103
  DeclaresVariable: '%{binding} %{must} debe declarar variables%{matching}'
104
+ Delegates: '%{binding} %{must} delegar'
104
105
  DiscardsExceptions: '%{binding} está ignorando excepciones silenciosamiente'
105
106
  DoesConsolePrint: '%{binding} está realizando impresiones por pantalla'
106
- DoesNilTest: '%{binding} hace comparaciones contra <i>%{keyword_null}</i>'
107
- DoesNullTest: '%{binding} hace comparaciones contra <i>%{keyword_null}</i>'
107
+ DoesNilTest: '%{binding} hace comparaciones contra <i>%{keyword_Null}</i>'
108
+ DoesNullTest: '%{binding} hace comparaciones contra <i>%{keyword_Null}</i>'
108
109
  DoesTypeTest: '%{binding} hace comparaciones contra strings'
109
- HasAssignmentReturn: '%{binding} devuelve el resultado de una asignación'
110
+ HasAssignmentCondition: '%{binding} evalúa el resultado de una asignación en donde se esperaba una expresión booleana. ¿Quizás quisiste usar el operador <i>%{operator_Equal}</i>?'
111
+ HasAssignmentReturn: '%{binding} devuelve el resultado de una asignación. ¿Quizás quisiste usar el operador <i>%{operator_Equal}</i>?'
110
112
  HasCodeDuplication: '%{binding} tiene código repetido'
111
- HasEmptyIfBranches: '%{binding} tiene ramas de <i>%{keyword_if}</i> vacías'
112
- HasEmptyRepeat: '%{binding} tiene un <i>%{keyword_repeat}</i> vacío'
113
+ HasDeclarationTypos_named: 'La solución parece tener un error de tipeo: debe declarar %{target}, pero declara %{binding}. ¿Quizás quisiste decir %{target}?'
114
+ HasEmptyIfBranches: '%{binding} tiene ramas de <i>%{keyword_If}</i> vacías'
115
+ HasEmptyRepeat: '%{binding} tiene un <i>%{keyword_Repeat}</i> vacío'
113
116
  HasLongParameterList: '%{binding} tiene demasiados parámetros. Te podría estar faltando una abstracción'
114
117
  HasMisspelledBindings: '%{binding} está mal escrito. Revisá la ortografía y procurá no usar abreviaturas'
115
118
  HasMisspelledIdentifiers: '%{binding} está mal escrito. Revisá la ortografía y procurá no usar abreviaturas'
@@ -119,12 +122,13 @@ es:
119
122
  HasRedundantLambda: '%{binding} tiene lambdas innecesarias'
120
123
  HasRedundantLocalVariableReturn: '%{binding} usa variables locales innecesarias; podés retornar directamente la expresión'
121
124
  HasRedundantParameter: '%{binding} tiene parámetros innecesarios (se pueden eliminar mediante point-free)'
122
- HasRedundantReduction: '%{binding} usa <i>%{keyword_is}</i>, pero no realiza cálculos'
123
- HasRedundantRepeat: '%{binding} tiene un <i>%{keyword_repeat}</i> innecesario'
125
+ HasRedundantReduction: '%{binding} usa <i>%{keyword_Is}</i>, pero no realiza cálculos'
126
+ HasRedundantRepeat: '%{binding} tiene un <i>%{keyword_Repeat}</i> innecesario'
124
127
  HasTooManyMethods: '%{binding} tiene demasiados métodos'
125
128
  HasTooShortBindings: '%{binding} es un identificador muy corto'
126
129
  HasTooShortIdentifiers: '%{binding} es un identificador muy corto'
127
130
  HasUnreachableCode: '%{binding} tiene código inalcanzable'
131
+ HasUsageTypos_named: 'La solución parece tener un error de tipeo: debe usar %{target}, pero usa %{binding}. ¿Quizás quisiste decir %{target}?'
128
132
  HasWrongCaseBindings: '%{binding} no respeta la convención de nombres'
129
133
  HasWrongCaseIdentifiers: '%{binding} no respeta la convención de nombres'
130
134
  Implements_except: '%{binding} %{must} implementar interfaces distintas de %{target}'
@@ -156,7 +160,9 @@ es:
156
160
  Returns: '%{binding} %{must} retornar%{matching}'
157
161
  ReturnsNil: '%{binding} retorna null, lo cual es una mala práctica'
158
162
  ReturnsNull: '%{binding} retorna null, lo cual es una mala práctica'
159
- ShouldInvertIfCondition: '%{binding} debería invertir la condición del <i>%{keyword_if}</i> e intercambiar las ramas'
163
+ ShouldInvertIfCondition: '%{binding} debería invertir la condición del <i>%{keyword_If}</i> e intercambiar las ramas'
164
+ SubordinatesDeclarationsTo: 'Todas las declaraciones en %{binding} %{must} ser usadas desde %{target}'
165
+ SubordinatesDeclarationsToEntryPoint: 'Todas las declaraciones en %{binding} %{must} deben ser usadas desde un <i>%{keyword_EntryPoint}</i>'
160
166
  TypesAs_named: '%{binding} %{must} ser de tipo %{target}'
161
167
  TypesAs: '%{binding} %{must} tipar'
162
168
  TypesParameterAs_except: '%{binding} %{must} tipar parámetros con un tipo diferente a %{target}'
@@ -169,38 +175,61 @@ es:
169
175
  Uses_like: '%{binding} %{must} delegar en algo parecido a %{target}'
170
176
  Uses_named: '%{binding} %{must} utilizar %{target}'
171
177
  Uses: '%{binding} %{must} delegar'
178
+ UsesAnd: '%{binding} %{must} utilizar <i>%{operator_And}</i>'
172
179
  UsesAnonymousVariable: '%{binding} %{must} utilizar una variable anónima'
180
+ UsesBackwardComposition: '%{binding} %{must} utilizar <i>%{operator_BackwardComposition}</i>'
181
+ UsesBitwiseAnd: '%{binding} %{must} utilizar <i>%{operator_BitwiseAnd}</i>'
182
+ UsesBitwiseLeftShift: '%{binding} %{must} utilizar <i>%{operator_BitwiseLeftShift}</i>'
183
+ UsesBitwiseOr: '%{binding} %{must} utilizar <i>%{operator_BitwiseOr}</i>'
184
+ UsesBitwiseRightShift: '%{binding} %{must} utilizar <i>%{operator_BitwiseRightShift}</i>'
185
+ UsesBitwiseXor: '%{binding} %{must} utilizar <i>%{operator_BitwiseXor}</i>'
173
186
  UsesComposition: '%{binding} %{must} usar composición'
174
187
  UsesComprehension: '%{binding} %{must} emplear listas por comprensión'
175
188
  UsesConditional: '%{binding} %{must} utilizar condicionales'
176
189
  UsesCut: '%{binding} usa el operador !, lo cual es una mala práctica'
190
+ UsesDivide: '%{binding} %{must} utilizar <i>%{operator_Divide}</i>'
177
191
  UsesDyamicPolymorphism: '%{binding} %{must} usar polimorfismo'
178
192
  UsesDynamicMethodOverload: '%{binding} %{must} usar sobrecarga'
193
+ UsesEqual: '%{binding} %{must} utilizar <i>%{operator_Equal}</i>'
179
194
  UsesExceptionHandling: '%{binding} %{must} realizar manejo de excepciones'
180
195
  UsesExceptions: '%{binding} %{must} usar excepciones'
181
- UsesFail: '%{binding} usa <i>%{keyword_fail}</li>, lo cual es una mala práctica'
196
+ UsesFail: '%{binding} usa <i>%{keyword_Fail}</li>, lo cual es una mala práctica'
182
197
  UsesFindall: '%{binding} %{must} utilizar <i>%{keyword_findall}</i>'
183
- UsesForall: '%{binding} %{must} utilizar <i>%{keyword_forall}</i>'
184
- UsesForeach: '%{binding} %{must} usar <i>%{keyword_foreach}</i>%{matching}'
185
- UsesForLoop: '%{binding} %{must} usar <i>%{keyword_for}</i>%{matching}'
198
+ UsesForall: '%{binding} %{must} utilizar <i>%{keyword_Forall}</i>'
199
+ UsesForeach: '%{binding} %{must} usar <i>%{keyword_Foreach}</i>%{matching}'
200
+ UsesForLoop: '%{binding} %{must} usar <i>%{keyword_For}</i>%{matching}'
201
+ UsesForwardComposition: '%{binding} %{must} utilizar <i>%{operator_ForwardComposition}</i>'
202
+ UsesGreatherOrEqualThan: '%{binding} %{must} utilizar <i>%{operator_GreatherOrEqualThan}</i>'
203
+ UsesGreatherThan: '%{binding} %{must} utilizar <i>%{operator_GreatherThan}</i>'
186
204
  UsesGuards: '%{binding} %{must} usar guardas%{matching}'
187
- UsesIf: '%{binding} %{must} usar <i>%{keyword_if}</i>%{matching}'
205
+ UsesHash: '%{binding} %{must} utilizar <i>%{operator_Hash}</i>'
206
+ UsesIf: '%{binding} %{must} usar <i>%{keyword_If}</i>%{matching}'
188
207
  UsesInheritance: '%{binding} %{must} usar herencia'
189
208
  UsesLambda: '%{binding} %{must} emplear expresiones lambda%{matching}'
190
- UsesLogic: '%{binding} %{must} usar expresiones booleanas'
209
+ UsesLessOrEqualThan: '%{binding} %{must} utilizar <i>%{operator_LessOrEqualThan}</i>'
210
+ UsesLessThan: '%{binding} %{must} utilizar <i>%{operator_LessThan}</i>'
211
+ UsesLogic: '%{binding} %{must} usar operadores booleanos'
191
212
  UsesLoop: '%{binding} %{must} usar un bucle'
192
213
  UsesMath: '%{binding} %{must} usar expresiones matemáticas'
214
+ UsesMinus: '%{binding} %{must} utilizar <i>%{operator_Minus}</i>'
193
215
  UsesMixin: '%{binding} %{must} utilizar mixins'
194
216
  UsesMixins: '%{binding} %{must} usar mixins'
195
- UsesNot: '%{binding} %{must} utilizar <i>%{keyword_not}</i>'
217
+ UsesModulo: '%{binding} %{must} utilizar <i>%{operator_Modulo}</i>'
218
+ UsesMultiply: '%{binding} %{must} utilizar <i>%{operator_Multiply}</i>'
219
+ UsesNegation: '%{binding} %{must} utilizar <i>%{operator_Negation}</i>'
220
+ UsesNot: '%{binding} %{must} utilizar <i>%{keyword_Not}</i>'
221
+ UsesNotEqual: '%{binding} %{must} utilizar <i>%{operator_NotEqual}</i>'
196
222
  UsesObjectComposition: '%{binding} %{must} usar composición'
223
+ UsesOr: '%{binding} %{must} utilizar <i>%{operator_Or}</i>'
224
+ UsesOtherwise: '%{binding} %{must} utilizar <i>%{operator_Otherwise}</i>'
197
225
  UsesPatternMatching: '%{binding} %{must} utilizar pattern matching'
198
- UsesRepeat: '%{binding} %{must} usar <i>%{keyword_repeat}</i>%{matching}'
199
- UsesRepeatOf: '%{binding} %{must} usar un <i>%{keyword_repeat}</i> de %{target}'
226
+ UsesPlus: '%{binding} %{must} utilizar <i>%{operator_Plus}</i>'
227
+ UsesRepeat: '%{binding} %{must} usar <i>%{keyword_Repeat}</i>%{matching}'
228
+ UsesRepeatOf: '%{binding} %{must} usar un <i>%{keyword_Repeat}</i> de %{target}'
200
229
  UsesStaticMethodOverload: '%{binding} %{must} usar sobrecarga'
201
230
  UsesStaticPolymorphism: '%{binding} %{must} usar polimorfismo'
202
- UsesSwitch: '%{binding} %{must} utilizar un <i>%{keyword_switch}</i>'
231
+ UsesSwitch: '%{binding} %{must} utilizar un <i>%{keyword_Switch}</i>'
203
232
  UsesTemplateMethod: '%{binding} %{must} usar un método plantilla'
204
233
  UsesUnificationOperator: '%{binding} usa el operador de unificación (=)'
205
- UsesWhile: '%{binding} %{must} utilizar un <i>%{keyword_while}</i>'
206
- UsesYield: '%{binding} %{must} utilizar un <i>%{keyword_yield}</i>'
234
+ UsesWhile: '%{binding} %{must} utilizar un <i>%{keyword_While}</i>'
235
+ UsesYield: '%{binding} %{must} utilizar un <i>%{keyword_Yield}</i>'
@@ -6,7 +6,7 @@ pt:
6
6
  must: 'deve'
7
7
  solution: 'a solução'
8
8
  with_char: ' com o caractere <i>%{value}</i>'
9
- with_false: ' com o valor <i>%{keyword_false}</i>'
9
+ with_false: ' com o valor <i>%{keyword_False}</i>'
10
10
  with_literal: ' com um valor literal'
11
11
  with_logic: ' com uma expressão booleana'
12
12
  with_math: ' com uma expressão matemática'
@@ -15,7 +15,7 @@ pt:
15
15
  with_number: ' com o número <i>%{value}</i>'
16
16
  with_string: ' com a string <i>%{value}</i>'
17
17
  with_symbol: ' com o símbolo <i>%{value}</i>'
18
- with_true: ' com o valor <i>%{keyword_true}</i>'
18
+ with_true: ' com o valor <i>%{keyword_True}</i>'
19
19
  inspection:
20
20
  Assigns_except: '%{binding} %{must} atribuir algo diferente a %{target}%{matching}'
21
21
  Assigns_like: '%{binding} %{must} atribuir algo semelhante ao %{target}%{matching}'
@@ -47,7 +47,7 @@ pt:
47
47
  DeclaresComputationWithArity3_named: '%{target} %{must} tem três parâmetros'
48
48
  DeclaresComputationWithArity4_named: '%{target} %{must} tem quatro parâmetros'
49
49
  DeclaresComputationWithArity5_named: '%{target} %{must} tem cinco parâmetros'
50
- DeclaresEntryPoint: '%{binding} %{must} declarar um ponto de entrada%{matching}'
50
+ DeclaresEntryPoint: '%{binding} %{must} declarar um <i>%{keyword_EntryPoint}</i>%{matching}'
51
51
  DeclaresEnumeration_except: '%{binding} %{must} declarar enumerações que não são chamadas %{target}'
52
52
  DeclaresEnumeration_like: '%{binding} %{must} declarar uma enumeração de nome semelhante a %{target}'
53
53
  DeclaresEnumeration_named: '%{binding} %{must} declarar uma enumeração %{target}'
@@ -101,30 +101,34 @@ pt:
101
101
  DeclaresVariable_like: '%{binding} %{must} declarar uma variável semelhante a %{target}%{matching}'
102
102
  DeclaresVariable_named: '%{binding} %{must} declarar uma variável %{target}%{matching}'
103
103
  DeclaresVariable: '%{binding} %{must} deve declarar variáveis%{matching}'
104
+ Delegates: '%{binding} %{must} delegar'
104
105
  DiscardsExceptions: '%{binding} está silenciosamente ignorando exceções'
105
106
  DoesConsolePrint: '%{binding} está fazendo impressões na tela'
106
- DoesNilTest: '%{binding} faz comparações contra <i>%{keyword_null}</i>'
107
- DoesNullTest: '%{binding} faz comparações contra <i>%{keyword_null}</i>'
107
+ DoesNilTest: '%{binding} faz comparações contra <i>%{keyword_Null}</i>'
108
+ DoesNullTest: '%{binding} faz comparações contra <i>%{keyword_Null}</i>'
108
109
  DoesTypeTest: '%{binding} faz comparações contra strings'
109
- HasAssignmentReturn: '%{binding} retorna o resultado de uma tarefa'
110
+ HasAssignmentCondition: '%{binding} avalia o resultado de uma atribuição no qual uma expressão booleana era esperada. Talvez você queira usar o operador <i>%{operator_Equal}</i>?'
111
+ HasAssignmentReturn: '%{binding} retorna o resultado de uma atribuição. Talvez você queira usar o operador <i>%{operator_Equal}</i>?'
110
112
  HasCodeDuplication: '%{binding} tem código repetido'
111
- HasEmptyIfBranches: '%{binding} tem vazio <i>%{keyword_if}</i> ramos'
112
- HasEmptyRepeat: '%{binding} tem um <i>%{keyword_repeat}</i> vazio'
113
+ HasDeclarationTypos_named: 'A solução deve declarar %{target}, mas declara %{binding}. Você poderia ter cometido um erro de digitação?'
114
+ HasEmptyIfBranches: '%{binding} tem uma ramificaçao %{keyword_If} vazia'
115
+ HasEmptyRepeat: '%{binding} tem um <i>%{keyword_Repeat}</i> vazio'
113
116
  HasLongParameterList: '%{binding} tem muitos parâmetros. Você pode estar perdendo uma abstração.'
114
117
  HasMisspelledBindings: '%{binding} está incorreto. Verifique a ortografia e tente não usar abreviaturas'
115
118
  HasMisspelledIdentifiers: '%{binding} está incorreto. Verifique a ortografia e tente não usar abreviaturas'
116
119
  HasRedundantBooleanComparison: '%{binding} faz comparações booleanas desnecessárias'
117
120
  HasRedundantGuards: '%{binding} possui protetores desnecessários'
118
- HasRedundantIf: '%{binding} <i>%{keyword_if}</i> desnecessário'
121
+ HasRedundantIf: '%{binding} <i>%{keyword_If}</i> desnecessário'
119
122
  HasRedundantLambda: '%{binding} possui lambdas desnecessários'
120
123
  HasRedundantLocalVariableReturn: '%{binding} usa variáveis ​​locais desnecessárias; você pode retornar a expressão diretamente'
121
124
  HasRedundantParameter: '%{binding} possui parâmetros desnecessários (pode ser removido por ponto-livre)'
122
- HasRedundantReduction: '%{binding} usa <i>%{keyword_is}</i>, mas não executa cálculos'
123
- HasRedundantRepeat: '%{binding} tem <i>%{keyword_repeat}</i> desnecessário'
125
+ HasRedundantReduction: '%{binding} usa <i>%{keyword_Is}</i>, mas não executa cálculos'
126
+ HasRedundantRepeat: '%{binding} tem <i>%{keyword_Repeat}</i> desnecessário'
124
127
  HasTooManyMethods: '%{binding} tem muitos métodos'
125
128
  HasTooShortBindings: '%{binding} é um identificador muito curto'
126
129
  HasTooShortIdentifiers: '%{binding} é um identificador muito curto'
127
130
  HasUnreachableCode: '%{binding} tem código inacessível'
131
+ HasUsageTypos_named: 'A solução deve usar %{target}, mas usa %{binding}. Você poderia ter cometido um erro de digitação?'
128
132
  HasWrongCaseBindings: '%{binding} não respeita a convenção de nomenclatura'
129
133
  HasWrongCaseIdentifiers: '%{binding} não respeita a convenção de nomenclatura'
130
134
  Implements_except: '%{binding} %{must} implementar interfaces diferentes de %{target}'
@@ -144,7 +148,6 @@ pt:
144
148
  Raises_except: '%{binding} %{must} lançar exceções diferentes de %{target}'
145
149
  Raises_like: '%{binding} %{must} lançar exceções semelhantes a %{target}'
146
150
  Raises_named: '%{binding} %{must} launch %{target}'
147
- ShouldInvertIfCondition: '%{binding} deve inverter a condição da <i>%{keyword_if}</i> e trocar as ramos'
148
151
  Raises: '%{binding} %{must} lançar exceções'
149
152
  Rescues_except: '%{binding} %{must} capturar exceções que não sejam %{target}'
150
153
  Rescues_like: '%{binding} %{must} capturar exceções semelhantes a %{target}'
@@ -153,6 +156,9 @@ pt:
153
156
  Returns: '%{binding} %{must} retornar%{matching}'
154
157
  ReturnsNil: '%{binding} retorna nulo, o que é uma prática ruim'
155
158
  ReturnsNull: '%{binding} retorna nulo, o que é uma prática ruim'
159
+ ShouldInvertIfCondition: '%{binding} deve inverter a condição da <i>%{keyword_If}</i> e trocar as ramos'
160
+ SubordinatesDeclarationsTo: 'Todas as declarações em %{binding} %{must} ser usadas a partir de %{target}'
161
+ SubordinatesDeclarationsToEntryPoint: 'Todas as declarações em %{binding} %{must} devem ser usadas a partir de <i>%{keyword_EntryPoint}</i>'
156
162
  TypesAs_named: '%{binding} %{must} é do tipo %{target}'
157
163
  TypesAs: '%{binding} %{must} tem tipo'
158
164
  TypesReturnAs_named: '%{binding} %{must} tem tipo de valor de retorno %{target}'
@@ -161,36 +167,59 @@ pt:
161
167
  Uses_like: '%{binding} %{must} delegar algo semelhante ao %{target}'
162
168
  Uses_named: '%{binding} %{must} usar %{target}'
163
169
  Uses: '%{binding} %{must} delegar'
170
+ UsesAnd: '%{binding} %{must} utilizar <i>%{operator_And}</i>'
164
171
  UsesAnonymousVariable: '%{binding} %{must} usar uma variável anônima'
172
+ UsesBackwardComposition: '%{binding} %{must} utilizar <i>%{operator_BackwardComposition}</i>'
173
+ UsesBitwiseAnd: '%{binding} %{must} utilizar <i>%{operator_BitwiseAnd}</i>'
174
+ UsesBitwiseLeftShift: '%{binding} %{must} utilizar <i>%{operator_BitwiseLeftShift}</i>'
175
+ UsesBitwiseOr: '%{binding} %{must} utilizar <i>%{operator_BitwiseOr}</i>'
176
+ UsesBitwiseRightShift: '%{binding} %{must} utilizar <i>%{operator_BitwiseRightShift}</i>'
177
+ UsesBitwiseXor: '%{binding} %{must} utilizar <i>%{operator_BitwiseXor}</i>'
165
178
  UsesComposition: '%{binding} %{must} usar a composição'
166
179
  UsesComprehension: '%{binding} %{must} usar listas pelo entendimento'
167
180
  UsesConditional: '%{binding} %{must} usar conditional'
168
181
  UsesCut: '%{binding} usa o operador !, que é uma má prática'
182
+ UsesDivide: '%{binding} %{must} utilizar <i>%{operator_Divide}</i>'
169
183
  UsesDyamicPolymorphism: '%{binding} %{must} usar polimorfismo'
170
184
  UsesDynamicMethodOverload: '%{binding} %{must} usar sobrecarga'
185
+ UsesEqual: '%{binding} %{must} utilizar <i>%{operator_Equal}</i>'
171
186
  UsesExceptionHandling: '%{binding} %{must} executar o tratamento de exceção'
172
187
  UsesExceptions: '%{binding} %{must} usar exceções'
173
- UsesFail: '%{binding} usa <i>%{keyword_fail}</li>, o que é uma prática ruim'
188
+ UsesFail: '%{binding} usa <i>%{keyword_Fail}</li>, o que é uma prática ruim'
174
189
  UsesFindall: '%{binding} %{must} usar <i>%{keyword_findall}</i>'
175
- UsesForall: '%{binding} %{must} usar <i>%{keyword_forall}</i>'
176
- UsesFor: '%{binding} %{must} usar <i>%{keyword_for}</i>%{matching}'
177
- UsesForeach: '%{binding} %{must} usar <i>%{keyword_foreach}</i>%{matching}'
190
+ UsesFor: '%{binding} %{must} usar <i>%{keyword_For}</i>%{matching}'
191
+ UsesForall: '%{binding} %{must} usar <i>%{keyword_Forall}</i>'
192
+ UsesForeach: '%{binding} %{must} usar <i>%{keyword_Foreach}</i>%{matching}'
193
+ UsesForwardComposition: '%{binding} %{must} utilizar <i>%{operator_ForwardComposition}</i>'
194
+ UsesGreatherOrEqualThan: '%{binding} %{must} utilizar <i>%{operator_GreatherOrEqualThan}</i>'
195
+ UsesGreatherThan: '%{binding} %{must} utilizar <i>%{operator_GreatherThan}</i>'
178
196
  UsesGuards: '%{binding} %{must} usar guardas%{matching}'
179
- UsesIf: '%{binding} %{must} usar <i>%{keyword_if}</i>%{matching}'
197
+ UsesHash: '%{binding} %{must} utilizar <i>%{operator_Hash}</i>'
198
+ UsesIf: '%{binding} %{must} usar <i>%{keyword_If}</i>%{matching}'
180
199
  UsesInheritance: '%{binding} %{must} usar herança'
181
200
  UsesLambda: '%{binding} %{must} usar expressões lambda%{matching}'
201
+ UsesLessOrEqualThan: '%{binding} %{must} utilizar <i>%{operator_LessOrEqualThan}</i>'
202
+ UsesLessThan: '%{binding} %{must} utilizar <i>%{operator_LessThan}</i>'
203
+ UsesLogic: '%{binding} %{must} usar operadores booleanos'
182
204
  UsesLoop: '%{binding} %{must} usar um loop%{matching}'
183
- UsesLogic: '%{binding} %{must} usar expressões booleanas'
184
205
  UsesMath: '%{binding} %{must} usar expressões matemáticas'
206
+ UsesMinus: '%{binding} %{must} utilizar <i>%{operator_Minus}</i>'
185
207
  UsesMixins: '%{binding} %{must} usar mixins'
186
- UsesNot: '%{binding} %{must} usar <i>%{keyword_not}</i>'
208
+ UsesModulo: '%{binding} %{must} utilizar <i>%{operator_Modulo}</i>'
209
+ UsesMultiply: '%{binding} %{must} utilizar <i>%{operator_Multiply}</i>'
210
+ UsesNegation: '%{binding} %{must} utilizar <i>%{operator_Negation}</i>'
211
+ UsesNot: '%{binding} %{must} usar <i>%{keyword_Not}</i>'
212
+ UsesNotEqual: '%{binding} %{must} utilizar <i>%{operator_NotEqual}</i>'
187
213
  UsesObjectComposition: '%{binding} %{must} usar composição'
214
+ UsesOr: '%{binding} %{must} utilizar <i>%{operator_Or}</i>'
215
+ UsesOtherwise: '%{binding} %{must} utilizar <i>%{operator_Otherwise}</i>'
188
216
  UsesPatternMatching: '%{binding} %{must} usar o padrão de correspondência'
189
- UsesRepeat: '%{binding} %{must} usar <i>%{keyword_repeat}</i>%{matching}'
190
- UsesRepeatOf: '%{binding} %{must} usar uma <i>%{keyword_repeat}</i> de %{target}'
217
+ UsesPlus: '%{binding} %{must} utilizar <i>%{operator_Plus}</i>'
218
+ UsesRepeat: '%{binding} %{must} usar <i>%{keyword_Repeat}</i>%{matching}'
219
+ UsesRepeatOf: '%{binding} %{must} usar uma <i>%{keyword_Repeat}</i> de %{target}'
191
220
  UsesStaticMethodOverload: '%{binding} %{must} usar sobrecarga'
192
221
  UsesStaticPolymorphism: '%{binding} %{must} usar polimorfismo'
193
- UsesSwitch: '%{binding} %{must} usar um <i>%{keyword_switch}</i>'
222
+ UsesSwitch: '%{binding} %{must} usar um <i>%{keyword_Switch}</i>'
194
223
  UsesTemplateMethod: '%{binding} %{must} usar um _template method_'
195
224
  UsesUnificationOperator: '%{binding} usa o operador de unificação (=)'
196
- UsesWhile: '%{binding} %{must} usar um <i>%{keyword_while}</i>%{matching}'
225
+ UsesWhile: '%{binding} %{must} usar um <i>%{keyword_While}</i>%{matching}'
@@ -1,12 +1,43 @@
1
1
  module Mulang::Expectation
2
- SMELLS = %w(DiscardsExceptions DoesConsolePrint DoesNilTest DoesNullTest DoesTypeTest
3
- HasAssignmentReturn HasCodeDuplication HasEmptyIfBranches HasEmptyRepeat HasRedundantRepeat HasLongParameterList
4
- HasMisspelledBindings HasMisspelledIdentifiers
5
- HasRedundantBooleanComparison HasRedundantGuards HasRedundantIf
6
- HasRedundantLambda HasRedundantLocalVariableReturn HasRedundantParameter
7
- HasRedundantReduction HasTooManyMethods HasTooShortBindings HasTooShortIdentifiers HasUnreachableCode
8
- HasWrongCaseBinding HasWrongCaseIdentifiers IsLongCode OverridesEqualOrHashButNotBoth
9
- ReturnsNil ReturnsNull ShouldInvertIfCondition UsesCut UsesFail UsesUnificationOperator)
2
+ SMELLS = %w(
3
+ DiscardsExceptions
4
+ DoesConsolePrint
5
+ DoesNilTest
6
+ DoesNullTest
7
+ DoesTypeTest
8
+ HasAssignmentReturn
9
+ HasAssignmentCondition
10
+ HasCodeDuplication
11
+ HasDeclarationTypos
12
+ HasEmptyIfBranches
13
+ HasEmptyRepeat
14
+ HasLongParameterList
15
+ HasMisspelledBindings
16
+ HasMisspelledIdentifiers
17
+ HasRedundantBooleanComparison
18
+ HasRedundantGuards
19
+ HasRedundantIf
20
+ HasRedundantLambda
21
+ HasRedundantLocalVariableReturn
22
+ HasRedundantParameter
23
+ HasRedundantReduction
24
+ HasRedundantRepeat
25
+ HasTooManyMethods
26
+ HasTooShortBindings
27
+ HasTooShortIdentifiers
28
+ HasUnreachableCode
29
+ HasUsageTypos
30
+ HasWrongCaseBinding
31
+ HasWrongCaseIdentifiers
32
+ IsLongCode
33
+ OverridesEqualOrHashButNotBoth
34
+ ReturnsNil
35
+ ReturnsNull
36
+ ShouldInvertIfCondition
37
+ ShouldUseOtherwise
38
+ UsesCut
39
+ UsesFail
40
+ UsesUnificationOperator)
10
41
 
11
42
  def self.guess_type(expectation)
12
43
  if expectation[:binding] == '<<custom>>'
@@ -19,7 +50,7 @@ module Mulang::Expectation
19
50
  end
20
51
 
21
52
  def self.has_smell?(smell)
22
- SMELLS.include? smell
53
+ SMELLS.include? smell.split(':').first
23
54
  end
24
55
 
25
56
  def self.parse(expectation)
@@ -1,45 +1,69 @@
1
1
  module Mulang::Expectation::I18n
2
2
  class << self
3
- DEFAULT_KEYWORDS = {
4
- keyword_fail: :fail,
5
- keyword_false: :false,
6
- keyword_findall: :findall,
7
- keyword_for: :for,
8
- keyword_forall: :forall,
9
- keyword_foreach: :foreach,
10
- keyword_if: :if,
11
- keyword_is: :is,
12
- keyword_not: :not,
13
- keyword_null: :null,
14
- keyword_repeat: :repeat,
15
- keyword_switch: :switch,
16
- keyword_true: :true,
17
- keyword_while: :while,
18
- keyword_yield: :yield
19
- }
3
+ DEFAULT_TOKENS = {
4
+ keyword_EntryPoint: 'program',
5
+ keyword_Fail: 'fail',
6
+ keyword_False: 'false',
7
+ keyword_findall: 'findall',
8
+ keyword_For: 'for',
9
+ keyword_Forall: 'forall',
10
+ keyword_Foreach: 'foreach',
11
+ keyword_If: 'if',
12
+ keyword_Is: 'is',
13
+ keyword_Not: 'not',
14
+ keyword_Null: 'null',
15
+ keyword_Repeat: 'repeat',
16
+ keyword_Switch: 'switch',
17
+ keyword_True: 'true',
18
+ keyword_While: 'while',
19
+ keyword_Yield: 'yield',
20
+ operator_And: '&&',
21
+ operator_BackwardComposition: '.',
22
+ operator_Divide: '/',
23
+ operator_Equal: '==',
24
+ operator_ForwardComposition: '>>',
25
+ operator_GreatherOrEqualThan: '>=',
26
+ operator_GreatherThan: '>',
27
+ operator_Hash: 'hash',
28
+ operator_LessOrEqualThan: '<=',
29
+ operator_LessThan: '<',
30
+ operator_Minus: '-',
31
+ operator_Multiply: '*',
32
+ operator_Negation: '!',
33
+ operator_NotEqual: '!=',
34
+ operator_Or: '||',
35
+ operator_Otherwise: 'otherwise',
36
+ operator_Plus: '+',
37
+ operator_Modulo: '%',
38
+ operator_BitwiseOr: '|',
39
+ operator_BitwiseAnd: '&',
40
+ operator_BitwiseXor: '^',
41
+ operator_BitwiseLeftShift: '<<',
42
+ operator_BitwiseRightShift: '>>'
43
+ }.transform_values { |v| CGI::escapeHTML(v) }.freeze
20
44
 
21
- def translate(e, keywords = nil)
22
- translate!(e, keywords)
45
+ def translate(e, tokens = nil)
46
+ translate!(e, tokens)
23
47
  rescue
24
48
  '<unknown expectation>'
25
49
  end
26
50
 
27
- def translate!(e, keywords = nil)
51
+ def translate!(e, tokens = nil)
28
52
  e = e.as_v2
29
53
  key = key_for e.binding, e.inspection
30
- ::I18n.t key, translation_params(e, keywords)
54
+ ::I18n.t key, translation_params(e, tokens)
31
55
  end
32
56
 
33
57
  alias t translate
34
58
 
35
59
  private
36
60
 
37
- def translation_params(e, keywords)
38
- with_keywords keywords,
61
+ def translation_params(e, tokens)
62
+ with_tokens tokens,
39
63
  binding: t_binding(e.binding),
40
64
  target: t_target(e.inspection),
41
65
  must: t_must(e.inspection),
42
- matching: t_matching(keywords, e.inspection)
66
+ matching: t_matching(tokens, e.inspection)
43
67
  end
44
68
 
45
69
  def key_for(binding, inspection)
@@ -58,12 +82,12 @@ module Mulang::Expectation::I18n
58
82
  "<strong>#{parsed.target.value}</strong>" if parsed.target
59
83
  end
60
84
 
61
- def t_matching(keywords, parsed)
62
- ::I18n.t("mulang.expectation.#{parsed.matcher.type}", with_keywords(keywords, value: parsed.matcher.value)) if parsed.matcher
85
+ def t_matching(tokens, parsed)
86
+ ::I18n.t("mulang.expectation.#{parsed.matcher.type}", with_tokens(tokens, value: parsed.matcher.value)) if parsed.matcher
63
87
  end
64
88
 
65
- def with_keywords(keywords, params)
66
- params.merge(DEFAULT_KEYWORDS).merge(keywords || {})
89
+ def with_tokens(tokens, params)
90
+ params.merge(DEFAULT_TOKENS).merge(tokens || {})
67
91
  end
68
92
  end
69
93
  end
@@ -11,12 +11,12 @@ class Mulang::Expectation::Standard
11
11
  raise "Wrong inspection #{to_h}" unless inspection?
12
12
  end
13
13
 
14
- def translate(keywords = nil)
15
- Mulang::Expectation::I18n.translate self, keywords
14
+ def translate(tokens = nil)
15
+ Mulang::Expectation::I18n.translate self, tokens
16
16
  end
17
17
 
18
- def translate!(keywords = nil)
19
- Mulang::Expectation::I18n.translate! self, keywords
18
+ def translate!(tokens = nil)
19
+ Mulang::Expectation::I18n.translate! self, tokens
20
20
  end
21
21
 
22
22
  def to_h
@@ -72,7 +72,7 @@ class Mulang::Expectation::V0 < Mulang::Expectation::Standard
72
72
  end
73
73
 
74
74
  def as_v2_use
75
- Mulang::Expectation::V2.new binding, new_inspection(inspection.type.gsub('Has', 'Uses'), nil)
75
+ Mulang::Expectation::V2.new binding, new_inspection(inspection.type.gsub(/^Has/, 'Uses'), nil)
76
76
  end
77
77
 
78
78
  def as_v2_declare(simple_type)
@@ -1,4 +1,4 @@
1
1
  module Mulang
2
- VERSION = "5.2.0"
3
- MULANG_VERSION = "5.2.0"
2
+ VERSION = "5.3.0"
3
+ MULANG_VERSION = "5.3.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mulang
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-core