Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing fails on multiple typedef extensions #181

Closed
ruby0x1 opened this issue Mar 15, 2016 · 5 comments
Closed

Parsing fails on multiple typedef extensions #181

ruby0x1 opened this issue Mar 15, 2016 · 5 comments
Labels

Comments

@ruby0x1
Copy link

ruby0x1 commented Mar 15, 2016

I have a number of typedefs that have multiple "parent" types that it extends from,

typedef TypedefName = {

    > OneTypedef,
    > OtherTypedef,

}
  • the second trailing , is required for haxe compiler in previous versions (I think 3.1.x, not sure)
  • the multiple extensions were in 3.1.0
CLASS: some/package/TypedefName.hx
    Error: LINE - 1: Checker - Parsing failed: Unexpected >
Stacktrace: 
Called from haxeparser/HaxeParser.hx line 650
Called from haxeparser/HaxeParser.hx line 743
Called from haxeparser/HaxeParser.hx line 743
Called from haxeparser/HaxeParser.hx line 730
Called from haxeparser/HaxeParser.hx line 542
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 510
Called from haxeparser/HaxeParser.hx line 501
Called from haxeparser/HaxeParser.hx line 265
Called from checkstyle/Checker.hx line 119
Called from checkstyle/Checker.hx line 170
@ruby0x1
Copy link
Author

ruby0x1 commented Mar 15, 2016

Since I already have an issue open for parsing weirdness, I will mention this curiosity too:

I get this error from a file that has not one single ? in it.
I also get it from some files that do - but they are ternary operations.

Error: LINE - 1: Checker - Parsing failed: Unexpected ?
Stacktrace: 
Called from hxparse/Lexer.hx line 100
Called from checkstyle/Checker.hx line 105
Called from checkstyle/Checker.hx line 169

If you want to see these, run with just this rule over Actuate, it has quite a few of these ? errors

{
            "type": "IndentationCharacter",
            "props": {
                "severity": "ERROR",
                "character": "space"
            }
        }

@adireddy adireddy added the bug label Mar 15, 2016
adireddy added a commit that referenced this issue Mar 15, 2016
@adireddy
Copy link
Member

Referring this to @Simn. Temporarily added try catch block.

@AlexHaxe
Copy link
Member

The second problem seems to be related to #44, some files of actuate lib have a BOM:

./tests/test/TestSuite.hx:                C++ source, ASCII text
./tests/test/ExampleTest.hx:              C++ source, ASCII text
./tests/test/UpdateTest.hx:               C++ source, ASCII text, with CRLF line terminators
./tests/test/TweenTest.hx:                C++ source, ASCII text, with CRLF line terminators
./tests/test/TestMain.hx:                 C++ source, ASCII text
./documentation/ImportAll.hx:             ASCII text, with CRLF line terminators
./motion/MotionPath.hx:                   Perl5 module source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/easing/Quint.hx:                 C++ source, ASCII text, with CRLF line terminators
./motion/easing/Sine.hx:                  C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/easing/Bounce.hx:                C++ source, ASCII text, with CRLF line terminators
./motion/easing/Quart.hx:                 C++ source, ASCII text, with CRLF line terminators
./motion/easing/Expo.hx:                  C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/easing/Linear.hx:                C++ source, ASCII text, with CRLF line terminators
./motion/easing/IEasing.hx:               ASCII text, with CRLF line terminators
./motion/easing/Quad.hx:                  C++ source, ASCII text, with CRLF line terminators
./motion/easing/Back.hx:                  C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/easing/Elastic.hx:               C++ source, ASCII text, with CRLF line terminators
./motion/easing/Cubic.hx:                 C++ source, ASCII text, with CRLF line terminators
./motion/Actuate.hx:                      Perl5 module source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/actuators/PropertyDetails.hx:    C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/actuators/IGenericActuator.hx:   ASCII text, with CRLF line terminators
./motion/actuators/MethodActuator.hx:     C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/actuators/MotionPathActuator.hx: C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/actuators/GenericActuator.hx:    C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/actuators/SimpleActuator.hx:     C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/actuators/FilterActuator.hx:     C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
./motion/actuators/TransformActuator.hx:  C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators

@adireddy
Copy link
Member

To fix extensions issue Simn asked to raise a PR by porting parser.ml changes into haxeparser HaxeFoundation/haxe@606d5c7

Not sure if I can translate ocaml changes to Haxe.

AlexHaxe added a commit to AlexHaxe/haxe-checkstyle that referenced this issue Apr 14, 2016
AlexHaxe added a commit that referenced this issue Apr 14, 2016
@Simn
Copy link

Simn commented May 3, 2016

This has been fixed in haxeparser so the test should be updated and the issue closed.

AlexHaxe added a commit to AlexHaxe/haxe-checkstyle that referenced this issue May 16, 2016
AlexHaxe added a commit to AlexHaxe/haxe-checkstyle that referenced this issue Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants