Examples of stringMatched()


Examples of com.stevesoft.pat.Regex.stringMatched()

                s = r.stringMatched(2);
                if (!S.isEmpty(s)) {
                    //r = argsPattern;
                    r = new Regex("\\G(,\\s*)?((([a-zA-Z_][\\w$_]*)\\s*[=:]\\s*)?((?@())|'.'|(?@\"\")|[0-9\\.]+[l]?|[a-zA-Z_][a-zA-Z0-9_\\.]*(?@())*(?@[])*(?@())*(\\.[a-zA-Z][a-zA-Z0-9_\\.]*(?@())*(?@[])*(?@())*)*)|[_a-zA-Z][a-z_A-Z0-9]*)");
                    while (r.search(s)) {
                        params.addParameterDeclaration(r.stringMatched(4), r.stringMatched(5), ctx());
                    }
                }


                return new Directive(s, ctx()) {
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                s = r.stringMatched(2);
                if (!S.isEmpty(s)) {
                    //r = argsPattern;
                    r = new Regex("\\G(,\\s*)?((([a-zA-Z_][\\w$_]*)\\s*[=:]\\s*)?((?@())|'.'|(?@\"\")|[0-9\\.]+[l]?|[a-zA-Z_][a-zA-Z0-9_\\.]*(?@())*(?@[])*(?@())*(\\.[a-zA-Z][a-zA-Z0-9_\\.]*(?@())*(?@[])*(?@())*)*)|[_a-zA-Z][a-z_A-Z0-9]*)");
                    while (r.search(s)) {
                        params.addParameterDeclaration(r.stringMatched(4), r.stringMatched(5), ctx());
                    }
                }


                return new Directive(s, ctx()) {
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                String remain = remain();
                Regex r = reg(dialect());
                if (!r.search(remain)) {
                    raiseParseException("Error parsing @i18n statement. Correct usage: @i18n(\"key\", ...)");
                }
                final String matched = r.stringMatched();
                step(matched.length());
                String space = r.stringMatched(2);
                ctx.getCodeBuilder().addBuilder(new Token.StringToken(space, ctx));
                String s = S.stripBrace(r.stringMatched(1).replace("@i18n", ""));
                r = new Regex(innerPattern());
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                if (!r.search(remain)) {
                    raiseParseException("Error parsing @i18n statement. Correct usage: @i18n(\"key\", ...)");
                }
                final String matched = r.stringMatched();
                step(matched.length());
                String space = r.stringMatched(2);
                ctx.getCodeBuilder().addBuilder(new Token.StringToken(space, ctx));
                String s = S.stripBrace(r.stringMatched(1).replace("@i18n", ""));
                r = new Regex(innerPattern());
                if (r.search(s)) {
                    // "" or '' present so prefetch String or MessageFormat
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                }
                final String matched = r.stringMatched();
                step(matched.length());
                String space = r.stringMatched(2);
                ctx.getCodeBuilder().addBuilder(new Token.StringToken(space, ctx));
                String s = S.stripBrace(r.stringMatched(1).replace("@i18n", ""));
                r = new Regex(innerPattern());
                if (r.search(s)) {
                    // "" or '' present so prefetch String or MessageFormat
                    String args = r.stringMatched(3);
                    if (S.empty(args)) {
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                ctx.getCodeBuilder().addBuilder(new Token.StringToken(space, ctx));
                String s = S.stripBrace(r.stringMatched(1).replace("@i18n", ""));
                r = new Regex(innerPattern());
                if (r.search(s)) {
                    // "" or '' present so prefetch String or MessageFormat
                    String args = r.stringMatched(3);
                    if (S.empty(args)) {
                        String k = r.stringMatched(1);
                        s = "\"" + S.stripQuotation(k) + "\"";
                    } else {
                        String k = r.stringMatched(1);
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                r = new Regex(innerPattern());
                if (r.search(s)) {
                    // "" or '' present so prefetch String or MessageFormat
                    String args = r.stringMatched(3);
                    if (S.empty(args)) {
                        String k = r.stringMatched(1);
                        s = "\"" + S.stripQuotation(k) + "\"";
                    } else {
                        String k = r.stringMatched(1);
                        s = "\"" + S.stripQuotation(k) + "\", " + args;
                    }
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                    String args = r.stringMatched(3);
                    if (S.empty(args)) {
                        String k = r.stringMatched(1);
                        s = "\"" + S.stripQuotation(k) + "\"";
                    } else {
                        String k = r.stringMatched(1);
                        s = "\"" + S.stripQuotation(k) + "\", " + args;
                    }
                }
                // cannot pre-resolve, output S.i18n directly
                s = String.format("__i18n(%s)", s);
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                step(matched.length());
                if (matched.startsWith("\n") || matched.endsWith("\n")) {
                    ctx.getCodeBuilder().addBuilder(new Token.StringToken("\n", ctx));
                    Regex r0 = new Regex("\\n([ \\t\\x0B\\f]*).*");
                    if (r0.search(matched)) {
                        String blank = r0.stringMatched(1);
                        if (blank.length() > 0) {
                            ctx.getCodeBuilder().addBuilder(new Token.StringToken(blank, ctx));
                        }
                    }
                } else {
View Full Code Here

Examples of com.stevesoft.pat.Regex.stringMatched()

                        }
                    }
                } else {
                    Regex r0 = new Regex("([ \\t\\x0B\\f]*).*");
                    if (r0.search(matched)) {
                        String blank = r0.stringMatched(1);
                        if (blank.length() > 0) {
                            ctx.getCodeBuilder().addBuilder(new Token.StringToken(blank, ctx));
                        }
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.