Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1645] Fix TSS pegjs definition to work on newer pegjs versions

GitHub Issuen/a
TypeStory
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsStyling
Labelsn/a
ReporterEwan Harris
AssigneeBruce Wayne
Created2019-03-05T15:23:28.000+0000
Updated2019-03-05T15:23:28.000+0000

Description

Description

I attempted to generate a new TSS grammar using the latest pegjs version and it errored with the below. It looks to be coming from [this line](https://github.com/appcelerator/alloy/blob/784c0a7ea45510953533b1748dae0407316434b8/Alloy/grammar/tss.pegjs#L38), because of that, I would also be suspicious of [this line](https://github.com/appcelerator/alloy/blob/784c0a7ea45510953533b1748dae0407316434b8/Alloy/grammar/tss.pegjs#L51) The current grammar was generated with pegjs@0.7.0, it breaks using pegjs@0.8.0 and up
TypeError: Cannot read property '0' of null
    at peg$c11 (/Users/eharris/Documents/git/alloy/Alloy/grammar/tss.js:50:34)
    at peg$parsetopmembers (/Users/eharris/Documents/git/alloy/Alloy/grammar/tss.js:679:16)
    at peg$parsetopobject (/Users/eharris/Documents/git/alloy/Alloy/grammar/tss.js:502:18)
    at peg$parsestart (/Users/eharris/Documents/git/alloy/Alloy/grammar/tss.js:430:14)
    at Object.parse (/Users/eharris/Documents/git/alloy/Alloy/grammar/tss.js:3439:18)
    at Object.exports.loadStyle (/Users/eharris/Documents/git/alloy/Alloy/commands/compile/styler.js:293:19)
    at Object.exports.loadAndSortStyle (/Users/eharris/Documents/git/alloy/Alloy/commands/compile/styler.js:317:36)
    at /Users/eharris/Documents/git/alloy/Alloy/commands/compile/index.js:684:28
    at arrayEach (/Users/eharris/Documents/git/alloy/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/Users/eharris/Documents/git/alloy/node_modules/lodash/lodash.js:9359:14)
    at parseAlloyComponent (/Users/eharris/Documents/git/alloy/Alloy/commands/compile/index.js:680:6)
    at /Users/eharris/Documents/git/alloy/Alloy/commands/compile/index.js:451:6
    at arrayEach (/Users/eharris/Documents/git/alloy/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/Users/eharris/Documents/git/alloy/node_modules/lodash/lodash.js:9359:14)
    at /Users/eharris/Documents/git/alloy/Alloy/commands/compile/index.js:439:6
    at arrayEach (/Users/eharris/Documents/git/alloy/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/Users/eharris/Documents/git/alloy/node_modules/lodash/lodash.js:9359:14)
    at module.exports (/Users/eharris/Documents/git/alloy/Alloy/commands/compile/index.js:435:4)
    at Object.<anonymous> (/Users/eharris/Documents/git/alloy/Alloy/alloy.js:112:46)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
    at Module.require (internal/modules/cjs/loader.js:667:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/eharris/Documents/git/alloy/bin/alloy:3:1)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
    at internal/main/run_main_module.js:21:11 line: NaN

Comments

No comments

JSON Source