Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DH when hovering over unnamed token

  • Loading branch information...
commit c57b2b67142eaeca1ff0da7a79ad7eb8677315da 1 parent 68c2c03
@cognominal authored
View
2  META.info
@@ -1,6 +1,6 @@
{
"name" : "parse-tree-server",
- "0.0.10",
+ "version" : "0.0.8",
"description" : "parse tree server",
"depends" : ["JSON::Tiny"],
"source-url" : "http://github.com/cognominal/codeview"
View
6 README.md
@@ -42,9 +42,9 @@ Note: to install SFW, I created a gist https://gist.github.com/2887964
We call `lite` the code viewport. Lite stands for literate editor.
Lite has three modes: simple, rule and full mode. So we say
a "simple lite" or a "full lite" to denote such a viewport depending
-on its mode. In folded lite, only the code pane is visible.
-The code pane may splitted in to à la docco with comments in left, and
-code proper in right. (worked with static data).
+on its mode. In simple lite, only the code pane is visible.
+The code pane may splitted in two à la docco, with comments in left and
+code proper in right. (worked with static data. need to check with true code).
One should be able to show the code pane with or without docco. In the second
case he should be able to hide comments
View
28 TBD
@@ -1,19 +1,31 @@
# Next steps yet to be done
-* Display the rule used to reduce the current text (still need css)
-* Bug jnthn/pmichaud to get parse tree dumping in Perl 6
-* Install zbrew on MBP and open a NTA port
-* Setup a github page.
+'*' means TBD
+'+' means done
+remove '+' entries when not needed for context
+Easy, urgent, important tasks tends to move up
+Recurrent but important ones tend to be in the bottom
+
+* About to finish one part of DH (hovering over unnamed token) DONE
+* Need to do DH when hovering over a parent node (need delay to avoid firework effects)
* Parse path bar need to be scrollable
-* Support many highlighted view ports (use class instead if id to identify relevant HTML elements
+* Support many highlighted view ports (use class instead of id to identify relevant HTML elements
+* Support json parse trees for different parse engines (necessary to convince jnthn to help). That would be a bummer if I go public without Perl 6. Also json is not a representative grammar. It is too simple.
+* Display the rule used to reduce the current text (still need css)
+* (1) Bug jnthn/pmichaud to get parse tree dumping in Perl 6 (no luck so far)
+* Think about the combination of codeview and SFW. Combine them and rename to zbrew. And/or rethink what is a forked-SFW plugin
+* Install zbrew on my MBP and open a NAT port
+* mythomaniac lexers, like with Perl 5, what to do?
+* Setup a github page
* Use express to serve the files (SFW will use express anyway)
+* generate one file html (with css included)
* Dynamically generate the parse according to the suffix
-* Support json parse trees for different parse engines
* Split bin/matchToJson into a library and code calling it
+* Support local DH (meaning rest of lite view port being shallow highlighting)
* implement a recorder and a demo mode
* maybe create a .dot file to document the information flow
-* make it a SFW plugin (the previous steps are preparatory ones)
+* make it a SFW plugin (most of the previous steps are preparatory ones)
* create an IRC like plugin in SFW
-* Embed rakudo in nodejs.
+* Embed rakudo in nodejs to minimize latency.
* tests!! don't know yet how to do browser side tests. Probably stuff based on jsdom.
* Better doc
View
2  VERSION
@@ -1 +1 @@
-0.0.9
+0.0.7
View
5 bin/bump
@@ -11,8 +11,9 @@ for @fnms -> $fnm {
$_ = slurp $fnm;
# make sure we don't mess random files
die $usage unless m/parse\-tree\-server/;
- s/version\V+(\d+\.\d+.)(\d+)/{ $0 ~ $1+1 }/;
- $version = "$0$1";
+ s/(version\V+)(\d+\.\d+.)(\d+)/{ "$0$1" ~ $2+1 }/;
+ die qq|failed to match in "$fnm"| unless $/;
+ $version = "$1$2";
spit $fnm, $_;
}
spit 'VERSION', "$version\n";
View
4 css/zbrew.css
@@ -20,6 +20,10 @@
box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}
+.a {
+ color: #ff0000
+}
+
#offset-content {
height: 100px;
}
View
2  package.json
@@ -2,7 +2,7 @@
"name": "parse-tree-server",
"description": "parse tree server",
"keywords": ["web", "server", "syntax", "highlighter"],
- "0.0.10",
+ "version" : "0.0.8",
"author": "Stéphane Payrard <cognominal@gmail.com>",
"engines": { "node": ">=0.1.99" },
"bin": { "hilite-server": "./bin/hilite-server" },
View
38 src/hilite.coffee
@@ -45,7 +45,7 @@ $ ->
if ev.keyCode== 27 # escape enlarges the editing zone to the enclosing rule
t = ev.currentTarget
dadInCode = ($(".editing").parent().filter(".code"))[0];
- console.log dadInCode
+ console.log dadInC ode
if dadInCode?
$(".parse-subcrumb").removeClass "colored"
$(".code").removeClass "editing"
@@ -75,11 +75,25 @@ $ ->
hilite = (ev) ->
elt = ev.currentTarget
+ dehilite()
mkCrumbs(elt)
# extract the current rule to add it to the rule vieport
ruleElt = $('#current-rule')
- elt = elt.parentNode
- showRule rule if rule = ruleNm elt
+ dad = elt.parentNode
+ showRule rule if rule = ruleNm dad
+ unnamedP = (i) ->
+ r = !$(this).hasClass 'named'
+ console.log "#{r} #{i} #{elt}"
+ r
+ if unnamedP elt
+ # using .a > .a in ccss
+# $(dad).addClass 'a'
+ console.log elt
+ wtf = $(dad).children().filter(unnamedP)
+ wtf.addClass 'a'
+
+ dehilite = ->
+ $('.a').removeClass 'a'
showRule = (ruleNm) ->
@@ -125,16 +139,22 @@ $ ->
insertParseTree = (elt, data, id=0, prefix='') ->
-
- # append is just a turd :(
appendElt = (elt, s, klass) ->
elt.append '<span>'
- e = $ elt[0].lastChild
+ e = $ elt[0].lastChild # this sooo ugly
+
e.text s if s
- e.addClass 'docco-' + d if klass and d = docco[klass];
- e.addClass 'rule-' + klass if klass
+ if klass
+ # add a docco class for css sake
+ e.addClass 'docco-' + d if d = docco[klass];
+ # name of the rule associated to the current element
+ e.addClass 'rule-' + klass
+ # 'named' means 'rule-*'. Used ofr DH.
+ # May be early optimization; less code anyway
+ e.addClass 'named'
+ # unique id to hilite from the parse path pane (broken feature. why?)
+ e.attr 'id', prefix + id++ # `prefix` will be the viewport name.
e.addClass 'code' # is that necessary except for the englobing element?
- e.attr('id', prefix + id++)
return e
insertSubtree = (elt, subtree) ->
Please sign in to comment.
Something went wrong with that request. Please try again.