fix algorithm by NFA
fix nested module parse