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

Graph based droppability #186

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
97c37e4
Move to new architecture for droppability rules and shapes
dabbler0 Jul 14, 2016
cc52ddf
Fix bug where you can't drag something if it matches the context exactly
dabbler0 Jul 14, 2016
2d4cc64
Add parenthesis rules
dabbler0 Jul 14, 2016
c997d11
Rewrite parser priorities for sizeof() to avoid weird paren case and …
dabbler0 Jul 14, 2016
6faf556
Flesh out enough more colors that the palette works
dabbler0 Jul 14, 2016
0f4bd2d
Add node contexts for paren-unwrapping purposes
dabbler0 Jul 15, 2016
e6e6d9f
Fix nodeContext annotations for trailingText
dabbler0 Jul 15, 2016
c8f26ee
I actually don't know what changed
dabbler0 Jul 15, 2016
c28dc85
Update build to report errors
dabbler0 Jul 15, 2016
5972ee5
Move JavaScript to the new infrastructure, for the most part
dabbler0 Jul 18, 2016
1281efb
Move CoffeeScript over to new infrastructure as well for the most part
dabbler0 Jul 18, 2016
0fd6abe
Handle buttons and such
dabbler0 Jul 18, 2016
8cb7f3f
Fix all tests but one, which requires new infrastructure
dabbler0 Jul 18, 2016
73a376a
Clean up reparsing
dabbler0 Jul 19, 2016
ef83eab
Clean up error handling
dabbler0 Jul 19, 2016
68e639e
Fix all the tests for the new serialization method
dabbler0 Jul 19, 2016
bc81625
Merge upstream
dabbler0 Jul 19, 2016
395a7e6
Oops, finish merging
dabbler0 Jul 19, 2016
b2a6aff
Add necessary droppability graph file
dabbler0 Jul 19, 2016
a9838c3
Fix coffee precedences
dabbler0 Jul 19, 2016
b08dc64
Fix the rest of the tests
dabbler0 Jul 19, 2016
f4004af
Fix typo
dabbler0 Jul 19, 2016
7f6bed0
Add some additional tests exercising the new rules
dabbler0 Jul 20, 2016
0f0db8f
Add automatic graph generation tool
dabbler0 Jul 21, 2016
76c3a06
Add some comments.
dabbler0 Jul 21, 2016
84a4692
Clean up generate.py
dabbler0 Jul 21, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ module.exports = (grunt) ->
b.require './src/main.coffee'
b.transform coffeeify

w = watchify(b)
w = watchify(b, {
poll: true
})

# Compile once through first
stream = fs.createWriteStream 'dist/droplet-full.js'
Expand All @@ -210,17 +212,17 @@ module.exports = (grunt) ->
w.on 'update', ->
console.log 'File changed...'
stream = fs.createWriteStream 'dist/droplet-full.js'
try
w.bundle().pipe stream
stream.once 'close', ->
console.log 'Rebuilt.'
lrserver.changed {
body: {
files: ['dist/droplet-full.js']
}

w.bundle().on('error', (e) ->
console.log 'ERROR'
console.log '-----'
console.log e
).pipe(stream).once 'close', ->
console.log 'Rebuilt.'
lrserver.changed {
body: {
files: ['dist/droplet-full.js']
}
catch e
console.log 'BUILD FAILED.'
console.log e.stack
}

grunt.registerTask 'testserver', ['connect:testserver', 'watchify']
4 changes: 2 additions & 2 deletions antlr/C.g4
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ unaryExpression
| '++' unaryExpression
| '--' unaryExpression
| unaryOperator castExpression
| 'sizeof' unaryExpression
| 'sizeof' '(' typeName ')'
| 'sizeof' unaryExpression
| '_Alignof' '(' typeName ')'
| '&&' Identifier // GCC extension address of label
;
Expand Down Expand Up @@ -601,8 +601,8 @@ unaryExpression_DropletFile
| '++' unaryExpression EOF
| '--' unaryExpression EOF
| unaryOperator castExpression EOF
| 'sizeof' unaryExpression EOF
| 'sizeof' '(' typeName ')' EOF
| 'sizeof' unaryExpression EOF
| '_Alignof' '(' typeName ')' EOF
| '&&' Identifier // GCC extension address of label EOF
;
Expand Down
301 changes: 301 additions & 0 deletions antlr/CDroppabilityGraph.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
{
"assignmentExpression": [
"conditionalExpression"
],
"typeSpecifier": [
"atomicTypeSpecifier",
"typedefName",
"enumSpecifier",
"structOrUnionSpecifier"
],
"gccDeclaratorExtension": [
"gccAttributeSpecifier"
],
"unaryOperator_DropletFile": [],
"structOrUnion_DropletFile": [],
"initializer": [
"assignmentExpression"
],
"selectionStatement_DropletFile": [],
"additiveExpression": [
"multiplicativeExpression"
],
"parameterTypeList": [
"parameterList"
],
"storageClassSpecifier_DropletFile": [],
"gccDeclaratorExtension_DropletFile": [],
"abstractDeclarator": [
"pointer",
"directAbstractDeclarator"
],
"externalDeclaration": [
"declaration",
"functionDefinition"
],
"enumerator": [
"enumerationConstant"
],
"structOrUnionSpecifier": [],
"alignmentSpecifier_DropletFile": [],
"declarationSpecifiers2": [
"declarationSpecifier"
],
"compoundStatement_DropletFile": [],
"declarationSpecifiers": [
"declarationSpecifier"
],
"translationUnit": [
"externalDeclaration"
],
"structOrUnionSpecifier_DropletFile": [],
"shiftExpression_DropletFile": [],
"initDeclarator_DropletFile": [],
"multiplicativeExpression": [
"castExpression"
],
"structDeclaratorList_DropletFile": [],
"exclusiveOrExpression_DropletFile": [],
"structOrUnion": [],
"enumerationConstant_DropletFile": [],
"expressionStatement_DropletFile": [],
"designation_DropletFile": [],
"abstractDeclarator_DropletFile": [],
"directDeclarator": [],
"jumpStatement": [],
"labeledStatement_DropletFile": [],
"unaryExpression": [
"postfixExpression"
],
"declarationSpecifier": [
"typeQualifier",
"functionSpecifier",
"alignmentSpecifier",
"typeSpecifier",
"storageClassSpecifier"
],
"typedefName": [],
"relationalExpression": [
"shiftExpression"
],
"structDeclarationList": [
"structDeclaration"
],
"primaryExpression_DropletFile": [],
"specialMethodCall_DropletFile": [],
"gccAttribute_DropletFile": [],
"blockItemList_DropletFile": [],
"genericSelection": [],
"logicalAndExpression_DropletFile": [],
"structDeclaration_DropletFile": [],
"enumSpecifier": [],
"statement_DropletFile": [],
"functionSpecifier_DropletFile": [],
"genericAssocList": [
"genericAssociation"
],
"designatorList_DropletFile": [],
"parameterDeclaration_DropletFile": [],
"declaration": [
"staticAssertDeclaration"
],
"parameterTypeList_DropletFile": [],
"iterationStatement": [],
"logicalOrExpression_DropletFile": [],
"declarationSpecifiers2_DropletFile": [],
"nestedParenthesesBlock_DropletFile": [
0
],
"declarator": [
"directDeclarator"
],
"compilationUnit": [],
"initDeclaratorList_DropletFile": [],
"exclusiveOrExpression": [
"andExpression"
],
"jumpStatement_DropletFile": [],
"specifierQualifierList": [
"typeQualifier",
"typeSpecifier"
],
"typeName": [
"specifierQualifierList"
],
"enumerationConstant": [],
"relationalExpression_DropletFile": [],
"genericAssociation": [],
"expression_DropletFile": [],
"declarator_DropletFile": [],
"iterationStatement_DropletFile": [],
"postfixExpression_DropletFile": [],
"structDeclaratorList": [
"structDeclarator"
],
"initializerList": [
"initializer"
],
"enumeratorList_DropletFile": [],
"gccAttributeSpecifier": [],
"externalDeclaration_DropletFile": [],
"typeQualifierList": [
"typeQualifier"
],
"primaryExpression": [
"genericSelection"
],
"structDeclarationsBlock_DropletFile": [],
"structDeclaration": [
"staticAssertDeclaration"
],
"inclusiveOrExpression": [
"exclusiveOrExpression"
],
"andExpression": [
"equalityExpression"
],
"designatorList": [
"designator"
],
"designation": [],
"structDeclarationsBlock": [],
"initDeclaratorList": [
"initDeclarator"
],
"logicalAndExpression": [
"inclusiveOrExpression"
],
"multiplicativeExpression_DropletFile": [],
"assignmentOperator": [],
"structDeclarationList_DropletFile": [],
"expression": [
"assignmentExpression"
],
"directAbstractDeclarator": [],
"specialMethodCall": [],
"structDeclarator_DropletFile": [],
"initDeclarator": [
"declarator"
],
"structDeclarator": [
"declarator"
],
"gccAttributeList_DropletFile": [],
"staticAssertDeclaration": [],
"compoundStatement": [],
"enumeratorList": [
"enumerator"
],
"assignmentExpression_DropletFile": [],
"directDeclarator_DropletFile": [],
"gccAttribute": [],
"statement": [
"expressionStatement",
"selectionStatement",
"compoundStatement",
"jumpStatement",
"iterationStatement",
"labeledStatement"
],
"typeQualifier": [],
"declaration_DropletFile": [],
"equalityExpression": [
"relationalExpression"
],
"typeQualifier_DropletFile": [],
"constantExpression_DropletFile": [],
"atomicTypeSpecifier_DropletFile": [],
"inclusiveOrExpression_DropletFile": [],
"storageClassSpecifier": [],
"blockItemList": [
"blockItem"
],
"gccAttributeSpecifier_DropletFile": [],
"gccAttributeList": [
"gccAttribute"
],
"declarationSpecifiers_DropletFile": [],
"postfixExpression": [
"primaryExpression"
],
"castExpression": [
"unaryExpression"
],
"andExpression_DropletFile": [],
"selectionStatement": [],
"genericSelection_DropletFile": [],
"shiftExpression": [
"additiveExpression"
],
"identifierList": [],
"parameterList_DropletFile": [],
"alignmentSpecifier": [],
"typeQualifierList_DropletFile": [],
"typeSpecifier_DropletFile": [],
"conditionalExpression": [
"logicalOrExpression"
],
"parameterDeclaration": [
"declarationSpecifiers2"
],
"translationUnit_DropletFile": [],
"functionSpecifier": [
"gccAttributeSpecifier"
],
"castExpression_DropletFile": [],
"functionDefinition": [],
"argumentExpressionList_DropletFile": [],
"genericAssocList_DropletFile": [],
"blockItem": [
"specialMethodCall",
"declaration",
"statement"
],
"designator_DropletFile": [],
"expressionStatement": [],
"pointer": [],
"atomicTypeSpecifier": [],
"constantExpression": [
"conditionalExpression"
],
"argumentExpressionList": [
"assignmentExpression"
],
"unaryOperator": [],
"additiveExpression_DropletFile": [],
"logicalOrExpression": [
"logicalAndExpression"
],
"declarationList": [
"declaration"
],
"declarationList_DropletFile": [],
"labeledStatement": [],
"directAbstractDeclarator_DropletFile": [],
"typeName_DropletFile": [],
"assignmentOperator_DropletFile": [],
"equalityExpression_DropletFile": [],
"blockItem_DropletFile": [],
"declarationSpecifier_DropletFile": [],
"identifierList_DropletFile": [],
"compilationUnit_DropletFile": [],
"enumerator_DropletFile": [],
"pointer_DropletFile": [],
"functionDefinition_DropletFile": [],
"conditionalExpression_DropletFile": [],
"typedefName_DropletFile": [],
"staticAssertDeclaration_DropletFile": [],
"unaryExpression_DropletFile": [],
"enumSpecifier_DropletFile": [],
"specifierQualifierList_DropletFile": [],
"initializerList_DropletFile": [],
"parameterList": [
"parameterDeclaration"
],
"genericAssociation_DropletFile": [],
"designator": [],
"initializer_DropletFile": [],
"nestedParenthesesBlock": [
0
]
}
Loading