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

Python mode (aka text-paste) branch #187

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
209e696
Add text paste method
dabbler0 Mar 18, 2016
3ac4938
python mode dropdown menu and block color (WIP)
Jun 2, 2016
577f634
function names in modeOptions detected as block name, python mode demo
Jun 6, 2016
43a49af
implement handleButton for extending if/elses
Jun 13, 2016
36b8dca
fix text-paste with the hiddenInput value not updating
Jun 16, 2016
705aa62
C if/elseif/else amalgamation
dabbler0 Jul 6, 2016
0935880
Merge branch 'svg-grouping' into c_if_else
dabbler0 Jul 6, 2016
d4e5fcf
Add pipeline for mutation buttons
dabbler0 Jul 6, 2016
d129f15
Remove extraneous debug
dabbler0 Jul 6, 2016
bfa7674
Add necessary annotation pipeline
dabbler0 Jul 11, 2016
04eecb4
Merge branch 'svg-grouping' into c_if_else
dabbler0 Jul 11, 2016
05d6a78
Merge branch 'svg-grouping' into c_if_else
dabbler0 Jul 11, 2016
1c9afed
Add +/- buttons for functions and plumbing for potentially paren unwr…
dabbler0 Jul 11, 2016
cdc38cc
+/- buttons for declarator lists
dabbler0 Jul 11, 2016
6dbf7a9
Initializers and comma expressions
dabbler0 Jul 11, 2016
3f8d44d
Add button for if even when no else
dabbler0 Jul 11, 2016
fe888f2
Allow flexible button config
dabbler0 Jul 11, 2016
cfad85f
+/- buttons for functions
dabbler0 Jul 11, 2016
dc39662
Subtract button for if/else, and vertical glyphs
dabbler0 Jul 11, 2016
a6f87c8
Usability improvements, and dual buttons for declarations
dabbler0 Jul 12, 2016
809a104
Fix a bug with dragging mutation buttons
dabbler0 Jul 12, 2016
7778591
Undo capture for mutation buttons
dabbler0 Jul 12, 2016
df0617a
Move from parse annotations to droplet tree inspection for +/- buttons
dabbler0 Jul 12, 2016
d5228dd
Move more to structure examination
dabbler0 Jul 12, 2016
e9ba713
Move back to parsing for declarations to fix a bug
dabbler0 Jul 12, 2016
f4a7506
View socket bug fix
dabbler0 Jul 12, 2016
67056a2
Center glyphs in buttons
dabbler0 Jul 12, 2016
f1a097b
python mode adaptation to the updated tree walker (WIP)
Jul 13, 2016
c1b7a16
Merge branch 'master' of https://github.com/droplet-editor/droplet in…
Jul 13, 2016
8689eea
python block drop encourage/discourage at document level (WIP)
Jul 13, 2016
42cd6ec
Merge with upstream
dabbler0 Jul 13, 2016
1ec6e1e
python mode block drop to/from indent issue
Jul 13, 2016
8d699f3
Merge branch 'master' of https://github.com/droplet-editor/droplet in…
Jul 13, 2016
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
8fe78ce
Merge
dabbler0 Jul 19, 2016
0e23a77
Fix some merge conflicts and a typo
dabbler0 Jul 19, 2016
883ec5e
Fix tests for phantomjs
dabbler0 Jul 19, 2016
008f00d
Fix for tests
dabbler0 Jul 19, 2016
25cd0ce
Merge branch 'master' of https://github.com/droplet-editor/droplet in…
Jul 20, 2016
7f6bed0
Add some additional tests exercising the new rules
dabbler0 Jul 20, 2016
74acf89
Merge branch 'graph-based-droppability' into container-buttons
dabbler0 Jul 20, 2016
6dee597
Fix visual bug with buttons disappearing sometimes
dabbler0 Jul 20, 2016
6d26d59
Don't put an add button on struct declarations
dabbler0 Jul 20, 2016
4a84d0f
python mode basic tests; demo page minor bug fixed
Jul 20, 2016
7a14256
Allow type changing during block reparsing
dabbler0 Jul 21, 2016
012eeee
typo fixed
Jul 25, 2016
8db958a
tweaks to the treewalker (fixes the C mode unit tests)
Jul 25, 2016
1d6482f
Merge branch 'container-buttons' of https://github.com/droplet-editor…
Aug 8, 2016
f3941bd
adapting python mode to the container-buttons branch
Aug 8, 2016
e0d08ff
python mode: tests fixed, subtract button, pass stmt not working yet
Aug 17, 2016
ce34e2d
dropdown menu arrow icon color fixed
Aug 17, 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
31 changes: 19 additions & 12 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ browserify = require 'browserify'
coffeeify = require 'coffeeify'
watchify = require 'watchify'


livereload = require 'tiny-lr'

path = require 'path'
Expand Down Expand Up @@ -99,6 +100,7 @@ module.exports = (grunt) ->
'test/js/jstest.js': ['test/src/jstest.coffee']
'test/js/cstest.js': ['test/src/cstest.coffee']
'test/js/htmltest.js': ['test/src/htmltest.coffee']
'test/js/pytest.js': ['test/src/pytest.coffee']
options:
transform: ['coffeeify']
browserifyOptions:
Expand Down Expand Up @@ -193,7 +195,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 +214,20 @@ 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.loadNpmTasks 'grunt-keepalive'
grunt.registerTask 'testserver', ['connect:testserver', 'watchify']
grunt.registerTask 'serve', ['connect:testserver', 'keepalive']
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