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
// swift-tools-version:5.1 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "Example", | |
products: [ | |
.executable(name: "example", targets: ["Example"]) | |
], |
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
///////////////////////////////////////////////////////////////////////////////// | |
// 1: Abra o GitPod | |
// https://gitpod.io/#https://github.com/vinivendra/gryphon | |
// 2: Abra o arquivo test.swift, apague o conteúdo dele e cole este comentário: | |
// // gryphon output: test.kt | |
// 3: Rode o Gryphon com o seguinte comando: | |
// ./.build/debug/gryphon test.swift -emit-swiftAST -emit-rawAST -emit-AST -emit-kotlin |
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
// Entre no site abaixo para abrir o GitPod (talvez precise fazer login) | |
// https://gitpod.io/#https://github.com/vinivendra/Gryphon/ | |
// | |
// Quando abrir, rode o comando abaixo para desligar alguns avisos do Java | |
// $ unset JAVA_TOOL_OPTIONS | |
// | |
// | |
// | |
// Durante os exemplos, use os seguintes comandos para: | |
// - Traduzir um arquivo: |
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
// The full version of this implementation is at bit.ly/Kotlin2Survey | |
package com.example.kotlincalculator | |
/** | |
* Type used to represent error value thrown for invalid Calculator input. | |
* */ | |
sealed class CalculatorError(override val message: String): Exception(message) { | |
class NilInput(override val message: String): CalculatorError(message) | |
// ... |
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
// The full version of this implementation is at bit.ly/Kotlin1Survey | |
package com.example.kotlingryphoncalculator | |
/// Type used to represent error value thrown for invalid Calculator input. | |
public sealed class CalculatorError: Exception() { | |
class NilInput: CalculatorError() | |
// ... | |
} |
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
// The full version of this implementation is at bit.ly/Swift2Survey | |
/* | |
Implements the logic for a calculator. Performs the addition, substraction, | |
division, and multiplication operations. | |
*/ | |
import Foundation | |
open class Calculator { |
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
// The full version of this implementation is at bit.ly/Swift1Survey | |
// declaration: package com.example.kotlingryphoncalculator | |
import Foundation | |
/// Type used to represent error value thrown for invalid Calculator input. | |
public enum CalculatorError: Error { | |
case nilInput | |
// ... |
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
/* | |
Implements the logic for a calculator. Performs the addition, substraction, | |
division, and multiplication operations. | |
*/ | |
import Foundation | |
open class Calculator { | |
// MARK: - Properties |
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
#include "J2ObjC_header.h" | |
#pragma push_macro("INCLUDE_ALL_ComExampleJavacalculatorCalculator") | |
#ifdef RESTRICT_ComExampleJavacalculatorCalculator | |
#define INCLUDE_ALL_ComExampleJavacalculatorCalculator 0 | |
#else | |
#define INCLUDE_ALL_ComExampleJavacalculatorCalculator 1 | |
#endif | |
#undef RESTRICT_ComExampleJavacalculatorCalculator |
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
// declaration: package com.example.kotlingryphoncalculator | |
import Foundation | |
/// Type used to represent error value thrown for invalid Calculator input. | |
public enum CalculatorError: Error { | |
case invalidCharater | |
case multipleCharacters | |
case nilInput |
NewerOlder