Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Use PEG to prevent bugs#10

Merged
Kuniwak merged 48 commits intomasterfrom
peg
May 11, 2015
Merged

Use PEG to prevent bugs#10
Kuniwak merged 48 commits intomasterfrom
peg

Conversation

@Kuniwak
Copy link
Copy Markdown
Member

@Kuniwak Kuniwak commented Feb 22, 2015

  • Re-implement the parser with PEG
  • Implement a publisher
  • Implement a type builder for v1.2.0
  • Restore removed legacy tests for v1.2.0
  • Compatibility check for tj/dox

@Kuniwak Kuniwak added this to the v2.0.0 milestone Mar 8, 2015
@Kuniwak Kuniwak mentioned this pull request Apr 23, 2015
Kuniwak added 10 commits April 26, 2015 12:42
I want to destinguish between strings and nodes by the a naming method:

- "name:" mean that it is a name and the type is string
- "value: mean that it is a representation value and the type is Node
@qfox
Copy link
Copy Markdown
Contributor

qfox commented May 7, 2015

Tested just now:

  • package.json: main file is absent (lib/index was moved to lib/legacy/index);
  • not sure, but looks like there are different type objects (node instanceof require('jsdoctypeparser/lib/legacy').Builder.TypeUnion, etc...).

@Kuniwak
Copy link
Copy Markdown
Member Author

Kuniwak commented May 10, 2015

What remained for compatibility check for tj/dox.

@Kuniwak
Copy link
Copy Markdown
Member Author

Kuniwak commented May 10, 2015

I tried the following code based on tj/dox example.
And looks good to me.

/**
 * Escape the given `html`.
 *
 * @example
 *     utils.escape('<script></script>')
 *     // => '&lt;script&gt;&lt;/script&gt;'
 *
 * @param {string[][]} html string to be escaped
 * @return {{String}} escaped html
 * @api public
 */

exports.escape = function(html){
  return String(html)
    .replace(/&(?!\w+;)/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;');
};

@Kuniwak Kuniwak changed the title [WIP] Use PEG to prevent bugs Use PEG to prevent bugs May 10, 2015
@Kuniwak
Copy link
Copy Markdown
Member Author

Kuniwak commented May 10, 2015

@zxqfox Ready to be v1.2.0.
Finally, would you re-test it please?

@qfox
Copy link
Copy Markdown
Contributor

qfox commented May 10, 2015

@Kuniwak trying... ;-)

@qfox
Copy link
Copy Markdown
Contributor

qfox commented May 10, 2015

@Kuniwak It works! Sorry for delay 🌴

@qfox
Copy link
Copy Markdown
Contributor

qfox commented May 10, 2015

@Kuniwak Hm. I've found one trouble. What about multiline declarations?

/**
 * @returns {{rules: function(Object),
 *   configure: function(Object),
 *   cases: function(Array.<TestCase{it: string, code: Function, ?rules: Object, ?errors: *, ?skip: boolean}>),
 *   check: function(string)}}
 */

This one is parsed without syntax errors in current version:

{rules: function(Object), configure: function(Object), cases: function(Array.<TestCase{it: string, code: Function, ?rules: Object, ?errors: *, ?skip: boolean}>), check: function(string)}

@qfox
Copy link
Copy Markdown
Contributor

qfox commented May 10, 2015

False error. All is fine. There is an error in syntax. 👍 NICE!!!

Here are changes: https://github.com/jscs-dev/jscs-jsdoc/pull/105/files

Kuniwak added a commit that referenced this pull request May 11, 2015
Use PEG to prevent bugs

Resolve #7 #9 #14
@Kuniwak Kuniwak merged commit 5a814c9 into master May 11, 2015
@Kuniwak
Copy link
Copy Markdown
Member Author

Kuniwak commented May 11, 2015

Thanks, @zxqfox !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants