-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementa novas funções especiais de modificadores #115
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3bc751c
Implementa novo método calc()
VitBrandao d5e2028
Testes unitários para o método calcular()
VitBrandao 852e327
Implementa novo método gradiente-linear()
VitBrandao ab0809d
Testes unitaŕios - método gradiente-linear()
VitBrandao e86aada
Implementa novo método contraste()
VitBrandao a417b70
Implementa testes unitários de valores para o método contraste()
VitBrandao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Simbolo } from "../../lexador"; | ||
import { Metodo } from "./metodo"; | ||
|
||
export class Calcular extends Metodo { | ||
valor1: number; | ||
quantificador1: string; | ||
operador: string; | ||
valor2: number; | ||
quantificador2: string; | ||
traducao: string; | ||
|
||
constructor(valor1: Simbolo, quantificador1: Simbolo, operador: Simbolo, valor2: Simbolo, quantificador2: Simbolo) { | ||
super(); | ||
this.valor1 = Number(valor1.lexema); | ||
this.quantificador1 = quantificador1.lexema; | ||
this.operador = operador.lexema; | ||
this.valor2 = Number(valor2.lexema); | ||
this.quantificador2 = quantificador2.lexema; | ||
this.traducao = 'calc'; | ||
} | ||
|
||
paraTexto() { | ||
return `calc(${this.valor1}${this.quantificador1} ${this.operador} ${this.valor2}${this.quantificador2})` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Simbolo } from "../../lexador"; | ||
import { Metodo } from "./metodo"; | ||
|
||
export class Contraste extends Metodo { | ||
valor: number; | ||
quantificador: string; | ||
traducao: string; | ||
|
||
constructor(valor: Simbolo, quantificador: Simbolo) { | ||
super(); | ||
this.valor = Number(valor.lexema); | ||
|
||
this.quantificador = quantificador ? quantificador.lexema : null; | ||
this.traducao = 'contrast'; | ||
} | ||
|
||
paraTexto() { | ||
if (this.quantificador) { | ||
return `contrast(${this.valor}${this.quantificador})` | ||
} | ||
|
||
return `contrast(${this.valor})` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Simbolo } from "../../lexador"; | ||
import { Metodo } from "./metodo"; | ||
import { cores } from "../../modificadores/atributos/cores"; | ||
|
||
export class GradienteLinear extends Metodo { | ||
valorAngulo: number; | ||
quantificadorAngulo: string; | ||
cor1: string; | ||
cor2: string; | ||
traducao: string; | ||
|
||
constructor(valorAngulo: Simbolo, quantificadorAngulo: Simbolo, cor1: Simbolo, cor2: Simbolo) { | ||
super(); | ||
this.valorAngulo = Number(valorAngulo.lexema); | ||
this.quantificadorAngulo = quantificadorAngulo.lexema; | ||
this.cor1 = cor1.lexema; | ||
this.cor2 = cor2.lexema; | ||
this.traducao = 'linear-gradient'; | ||
} | ||
|
||
paraTexto() { | ||
this.cor1 = cores[this.cor1]; | ||
this.cor2 = cores[this.cor2]; | ||
return `linear-gradient(${this.valorAngulo}${this.quantificadorAngulo}, ${this.cor1}, ${this.cor2})` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eu vou aceitar a PR com
deg
, mas vou querer a unidadegraus
também. Vou abrir outra issue com isso.