Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static Type FindWord( System.String word ) {
- Type output = null;
- Type probe;
- var stack = theDictStack;
- System.Collections.Generic.IDictionary<System.String, Type> dict;
- while ( !stack.IsEmpty && ( null == output ) ) {
- dict = stack.Peek();
- if ( dict.TryGetValue( word, out probe ) ) {
- output = probe;
- break;
- }
- stack = stack.Pop();
- }
- if ( null == output ) {
- if ( word.StartsWith( "(" ) ) {
- output = Type.CreateString( word );
- } else if ( word.StartsWith( "/" ) ) {
- output = Type.CreateLiteral( word );
- } else {
- output = Type.AsNumber( word );
- }
- }
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement