Browse Source

Chunk Importer - convert character literals to strings #971
- Extend SmalltalkParser to convert character literals to Strings

Sean DeNigris 10 years ago
parent
commit
23e2867dfc
2 changed files with 256 additions and 196 deletions
  1. 248 194
      support/parser.js
  2. 8 2
      support/parser.pegjs

File diff suppressed because it is too large
+ 248 - 194
support/parser.js


+ 8 - 2
support/parser.pegjs

@@ -13,7 +13,13 @@ string         = ['] val:(("''" {return "'";} / [^'])*) ['] {
                             ._source_(text())
                             ._value_(val.join("").replace(/\"/ig, '"'));
                  }
-
+character      = "$" char:. 
+                  {
+                      return globals.ValueNode._new()
+                             ._position_((line()).__at(column()))
+                             ._source_(text())
+                             ._value_(char);
+                  }
 symbol         = "#" rest:bareSymbol {return rest;}
 bareSymbol         = val:(selector / binarySelector / node:string {return node._value();})
                   {
@@ -62,7 +68,7 @@ pseudoVariable = val:(
                               ._source_(text())
                               ._value_(val);
                    }
-parseTimeLiteral        = pseudoVariable / number / literalArray / string / symbol
+parseTimeLiteral        = pseudoVariable / number / literalArray / string / symbol / character
 runtimeLiteral        = dynamicDictionary / dynamicArray / block
 literal        = runtimeLiteral / parseTimeLiteral
 

Some files were not shown because too many files changed in this diff