diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
commit | 370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch) | |
tree | 491674f4c242e4d6ba0d04eafa305174c35a3391 /includes/cbt/CBTCompiler.php | |
parent | f4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff) |
Update auf 1.13.0
Diffstat (limited to 'includes/cbt/CBTCompiler.php')
-rw-r--r-- | includes/cbt/CBTCompiler.php | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/includes/cbt/CBTCompiler.php b/includes/cbt/CBTCompiler.php index 17f43500..75955797 100644 --- a/includes/cbt/CBTCompiler.php +++ b/includes/cbt/CBTCompiler.php @@ -9,8 +9,8 @@ require_once( dirname( __FILE__ ) . '/CBTProcessor.php' ); -/** - * Push a value onto the stack +/** + * Push a value onto the stack * Argument 1: value */ define( 'CBT_PUSH', 1 ); @@ -51,7 +51,7 @@ class CBTOp { } function name() { - $opcodeNames = array( + $opcodeNames = array( CBT_PUSH => 'PUSH', CBT_CAT => 'CAT', CBT_CATS => 'CATS', @@ -102,7 +102,7 @@ class CBTCompiler { } else { $text = true; } - + return $text; } @@ -121,13 +121,13 @@ class CBTCompiler { /** * Recursive workhorse for text mode. - * - * Processes text mode starting from offset $p, until either $end is - * reached or a closing brace is found. If $needClosing is false, a + * + * Processes text mode starting from offset $p, until either $end is + * reached or a closing brace is found. If $needClosing is false, a * closing brace will flag an error, if $needClosing is true, the lack - * of a closing brace will flag an error. + * of a closing brace will flag an error. * - * The parameter $p is advanced to the position after the closing brace, + * The parameter $p is advanced to the position after the closing brace, * or after the end. A CBTValue is returned. * * @private @@ -136,7 +136,7 @@ class CBTCompiler { $in =& $this->mText; $start = $p; $atStart = true; - + $foundClosing = false; while ( $p < $end ) { $matchLength = strcspn( $in, CBT_BRACE, $p, $end - $p ); @@ -162,9 +162,9 @@ class CBTCompiler { $this->mOps[] = $this->op( CBT_CAT, substr( $in, $p, $matchLength ) ); } - // Advance the pointer + // Advance the pointer $p = $pToken + 1; - + // Check for closing brace if ( $in[$pToken] == '}' ) { $foundClosing = true; @@ -184,7 +184,7 @@ class CBTCompiler { $atStart = false; } else { $this->mOps[] = $this->op( CBT_CATS ); - } + } } if ( $foundClosing && !$needClosing ) { $this->error( 'Errant closing brace', $p ); @@ -200,12 +200,12 @@ class CBTCompiler { /** * Recursive workhorse for function mode. * - * Processes function mode starting from offset $p, until either $end is - * reached or a closing brace is found. If $needClosing is false, a + * Processes function mode starting from offset $p, until either $end is + * reached or a closing brace is found. If $needClosing is false, a * closing brace will flag an error, if $needClosing is true, the lack - * of a closing brace will flag an error. + * of a closing brace will flag an error. * - * The parameter $p is advanced to the position after the closing brace, + * The parameter $p is advanced to the position after the closing brace, * or after the end. A CBTValue is returned. * * @private @@ -364,4 +364,3 @@ class CBTCompiler { '; } } - |