rn)
    return match ? {raw: pattern} : false
  }
)

/**
 * 正则匹配
 *
 * @param {Walker} walker 表达式字符串读取工具
 * @param {RegExp} pattern 正则表达式
 * @return {ASTNode|false} 解析得到的 AST，匹配失败时返回 false
 */
export const regexp = memoize(
  (walker, pattern) => {
    let match = walker.matchRegExp(pattern)
    return match ? {raw: match[0]} : false
  }
)

/**
 * 字符串词法分析类
 */
export default class Lexer {
  constructor () {
    this.types = {}
  }

  /**
   * 定义规则
   *
   * @param {Descriptor} descriptor 规则描述对象
   * @return {Rule} 结构化规则对象
   */
  set (descriptor) {
    let item = [def, descriptor]
    this.types[descriptor.type] = item
    return item
  }

  /**
   * 读取规则
   *
   * @param {string} 规则名称
   * @return {Rule} 结构化规则对象
   */
  get (type) {
    return this.types[type]
  }
}


/*
    This samples shows the creation of a multi-level directory which 
	has the same name for each of the directory level. Before this date 
	multi-level directory with same name on each level will only create 
	the first level 
	
	Example::
	
		dir = new Directory("../testfiles/dir_test/dir_test/dir_test/dir_test/dir_test")
		dir.Create()
		
	The above example will only create the directory ``"../testfiles/dir_test/"`` 
	neglecting all the sub level directory with the same name **dir_test**
	
	This issue has been resolve in the following commit 
	https://github.com/simple-lang/simple/commit/f45af071ee49ef37d80e88b141adae1e82a1cac0

	:copyright: 2018-2019, Azeez Adewale
	:license: MIT License Copyright (c) 2018 simple
	:author: Azeez Adewale <azeezadewale98@gmail.com>
	:date: March 23 2019
	:filename: create_directory.sim
*/
from simple.core.Object
from simple.util.Console
from simple.io.Directory

block main()
	dir = new Directory("../testfiles/dir_test/dir_test/dir_test/dir_test/dir_test")
	stdout.Println(dir)
	dir.Create()


#ifndef _MBEDTLS_DEBUG_H_
#define _MBEDTLS_DEBUG_H_

#include "osapi.h"

#defi