Skip to content

Commit

Permalink
1.0-M1: added warnings to convertFromCSS methods
Browse files Browse the repository at this point in the history
  • Loading branch information
adamldavis committed Mar 1, 2019
1 parent 7a322b1 commit bb52c7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/groovy/org/groocss/GrooCSS.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class GrooCSS extends Script implements CurrentKeyFrameHolder {
}
static void convertFile(Config conf = new Config(), File inf, File out) { convert conf, inf, out }

/** Converts files from CSS to GrooCSS (WARNING: EXPERIMENTAL, DO NOT ASSUME IT WORKS). */
@Deprecated
static void convertFromCSS(File inf, File out) {
Translator.convertFromCSS inf, out
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/groovy/org/groocss/Translator.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import groovy.transform.TypeChecked
import java.util.regex.Matcher

/**
* Translates from/to CSS.
* Translates from/to CSS. WARNING: EXPERIMENTAL, DO NOT ASSUME IT WORKS.
*/
@TypeChecked
class Translator {

interface Printer { void println(Object value) }
interface Reader { void eachLine(Closure closure) }

/** Converts from CSS to Groocss. */
/** Converts files from CSS to GrooCSS (WARNING: EXPERIMENTAL, DO NOT ASSUME IT WORKS). */
static void convertFromCSS(File inf, File out) {
out.withPrintWriter { pw -> convertFromCSS(new Reader() {
void eachLine(Closure closure) { inf.eachLine closure }
Expand All @@ -37,6 +37,7 @@ class Translator {
}) }
}

/** Converts files from CSS to GrooCSS (WARNING: EXPERIMENTAL, DO NOT ASSUME IT WORKS). */
static String convertFromCSS(String text) {
StringBuilder sb = new StringBuilder()
convertFromCSS(new Reader() {
Expand All @@ -47,7 +48,7 @@ class Translator {
sb.toString()
}

/** Converts from CSS to Groocss. */
/** Converts files from CSS to GrooCSS (WARNING: EXPERIMENTAL, DO NOT ASSUME IT WORKS). */
static void convertFromCSS(Reader inf, Printer pw) {
def state = [:]
inf.eachLine { String originalLine ->
Expand Down

0 comments on commit bb52c7a

Please sign in to comment.