src/com/christofferklang/pyxl/parsing/PyxlExpressionParsing.java
private boolean parsePyxlAttributeValue() {
        IElementType token = myBuilder.getTokenType();

        // Consume the start of an attribute.
        IElementType attrStartToken = null;
        if (token == PyxlTokenTypes.ATTRVALUE_START) {
            myBuilder.advanceLexer();
            attrStartToken = token;
        }

        boolean foundValue = false;
        while (true) {
            token = myBuilder.getTokenType();

            // Attempt to parse an embed expression.
            try {
                if (parsePyxlEmbed()) {
                    foundValue = true;
                    continue;
                }
            } catch (PyxlParsingException e) {
                break;
            }

            // Or consume literal attribute values.
            if (token == PyxlTokenTypes.ATTRVALUE) {
                foundValue = true;
                myBuilder.advanceLexer();
                continue;
            }

            if (attrStartToken != null) {
                if (token == PyxlTokenTypes.ATTRVALUE_END) {
                    myBuilder.advanceLexer();
                    return true;
                } else {
                    myBuilder.error("pyxl expected attribute end");
                    return false;
                }
            } else if (foundValue) {
                return true;
            } else {
                myBuilder.error("pyxl expected attribute value");
                return false;
            }
        }
        return false;
    }
/**
     * Parse a pyxl attribute value. If an error occurs while the attribute
     * value is being parsed a parse error will be set.
     *
     * @return true if a value was successfully parsed and false
     * otherwise.
     */
Parse a pyxl attribute value. If an error occurs while the attribute
value is being parsed a parse error will be set.

@return true if a value was successfully parsed and false
otherwise.
Parse a pyxl attribute value . If an error occurs while the attribute value is being parsed a parse error will be set . @return true if a value was successfully parsed and false otherwise .
private boolean parsePyxlAttributeValue() {
        IElementType token = myBuilder.getTokenType();
        IElementType attrStartToken = null;
        if (token == PyxlTokenTypes.ATTRVALUE_START) {
            myBuilder.advanceLexer();
            attrStartToken = token;
        }
        boolean foundValue = false;
        while (true) {
            token = myBuilder.getTokenType();
            try {
                if (parsePyxlEmbed()) {
                    foundValue = true;
                    continue;
                }
            } catch (PyxlParsingException e) {
                break;
            }
            if (token == PyxlTokenTypes.ATTRVALUE) {
                foundValue = true;
                myBuilder.advanceLexer();
                continue;
            }
            if (attrStartToken != null) {
                if (token == PyxlTokenTypes.ATTRVALUE_END) {
                    myBuilder.advanceLexer();
                    return true;
                } else {
                    myBuilder.error("pyxl expected attribute end");
                    return false;
                }
            } else if (foundValue) {
                return true;
            } else {
                myBuilder.error("pyxl expected attribute value");
                return false;
            }
        }
        return false;
    }
private boolean parsePyxlAttributeValue ( ) { IElementType token = myBuilder . getTokenType ( ) ; IElementType attrStartToken = null ; if ( token == PyxlTokenTypes . ATTRVALUE_START ) { myBuilder . advanceLexer ( ) ; attrStartToken = token ; } boolean foundValue = false ; while ( true ) { token = myBuilder . getTokenType ( ) ; try { if ( parsePyxlEmbed ( ) ) { foundValue = true ; continue ; } } catch ( PyxlParsingException e ) { break ; } if ( token == PyxlTokenTypes . ATTRVALUE ) { foundValue = true ; myBuilder . advanceLexer ( ) ; continue ; } if ( attrStartToken != null ) { if ( token == PyxlTokenTypes . ATTRVALUE_END ) { myBuilder . advanceLexer ( ) ; return true ; } else { myBuilder . error ( "pyxl expected attribute end" ) ; return false ; } } else if ( foundValue ) { return true ; } else { myBuilder . error ( "pyxl expected attribute value" ) ; return false ; } } return false ; }
Parse a pyxl attribute value.
Parse a pyxl attribute value .
// Consume the start of an attribute. // Attempt to parse an embed expression. // Or consume literal attribute values.