Changeset 2293 for lang/actionscript/flmml/trunk/src
- Timestamp:
- 12/02/07 19:16:16 (5 years ago)
- Location:
- lang/actionscript/flmml/trunk/src
- Files:
-
- 3 modified
-
com/txt_nifty/sketch/flmml/MML.as (modified) (3 diffs)
-
com/txt_nifty/sketch/flmml/MWarning.as (modified) (1 diff)
-
flmml.swf (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MML.as
r2157 r2293 397 397 } 398 398 399 protected function processMacro(str:String):void { 400 m_string = str; 399 protected function processMacro():void { 401 400 begin(); 402 401 var top:int = 1; … … 469 468 } 470 469 470 protected function processComment(str:String):void { 471 m_string = str; 472 begin(); 473 var commentStart:int = -1; 474 while(m_letter < m_string.length) { 475 var c:String = getCharNext(); 476 switch(c) { 477 case '/': 478 if (getChar() == '*') { 479 if (commentStart < 0) commentStart = m_letter - 1; 480 next(); 481 } 482 break; 483 case '*': 484 if (getChar() == '/') { 485 if (commentStart >= 0) { 486 m_string = remove(m_string, commentStart, m_letter); 487 m_letter = commentStart; 488 commentStart = -1; 489 } 490 else { 491 warning(MWarning.UNOPENED_COMMENT, ""); 492 } 493 } 494 break; 495 default: 496 break; 497 } 498 } 499 if (commentStart >= 0) warning(MWarning.UNCLOSED_COMMENT, ""); 500 } 501 471 502 static public function removeWhitespace(str:String):String { 472 503 return str.replace(new RegExp("[ \n\r\t\f]+","g"),""); … … 496 527 m_form = MOscillator.PULSE; 497 528 498 processMacro(str); 529 processComment(str); 530 //trace(m_string); 531 processMacro(); 499 532 //trace(m_string); 500 533 m_string = removeWhitespace(m_string); -
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MWarning.as
r1276 r2293 1 1 package com.txt_nifty.sketch.flmml { 2 2 public final class MWarning { 3 public static const UNKNOWN_COMMAND:int = 0; 4 public static const UNCLOSED_REPEAT:int = 1; 3 public static const UNKNOWN_COMMAND:int = 0; 4 public static const UNCLOSED_REPEAT:int = 1; 5 public static const UNOPENED_COMMENT:int = 2; 6 public static const UNCLOSED_COMMENT:int = 3; 5 7 public static const s_string:Array = [ 6 8 "対応していないコマンド '%s' があります。", 7 "終わりが見つからない繰り返しがあります。" 9 "終わりが見つからない繰り返しがあります。", 10 "始まりが見つからないコメントがあります。", 11 "終わりが見つからないコメントがあります。" 8 12 ]; 9 13 public static function getString(warnId:int, str:String):String {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)