Search found 15 matches

by runsun
01.01.2016 05:46
Forum: Lexers
Topic: OpenSCAD lexer
Replies: 6
Views: 4482

Cool !!

With this lexer, I've introduced SynWrite to the 3D modeling community:

http://www.thingiverse.com/thing:1237864
http://forum.openscad.org/Happy-New-Yea ... 15402.html
by runsun
27.12.2015 23:45
Forum: Lexers
Topic: How to allow ( ) in func parameters ?
Replies: 3
Views: 2151

this cannot be done with skip. () inside (). so u need grammar. one grammar rule is Par and one Func which uses "(" Par ")" Thx. I tried this: Params = <Identifier> | Params <Identifier> | Params (',' | '.' | ';' | ':' | '[' | ']' | '(' | ')' | '=' | '"'); func = 'function'...
by runsun
27.12.2015 17:31
Forum: Lexers
Topic: How to allow ( ) in func parameters ?
Replies: 3
Views: 2151

How to allow ( ) in func parameters ?

I have the following OpenSCAD code: function f1( c,d=0,k=[] )= <statements> ; I was able to make a foldable for it with a common symbol parser [\{\},\<\>;\#\(\)\[\]=\.\*\+\$-\?/&] and 2 rules: rule_func<id>(..)=... 0 Equal <symbol> = 1 Equal <symbol> ) 2 Skip < all tokens > 3 Equal <symbol> ( 4 ...
by runsun
25.12.2015 17:29
Forum: Lexers
Topic: Anyway to catch module with comments in module header?
Replies: 4
Views: 2190

I think I got it to work. First create a

module <id> (...) {

then

module <id> (...) <comment> {

where <comment> and ... are tokens to skip. Place the 2nd one in the bottom of rules.
by runsun
25.12.2015 17:18
Forum: Lexers
Topic: Anyway to catch module with comments in module header?
Replies: 4
Views: 2190

grammar is **final try if noone works. try C lexer for this file with m1/m2. it works and shows m1/m2 in tree. it has rule for {....} and new rule for func- not 1 rule for "func{..}" and rule "func" is "init closed". If I use one for {...} and one for module{...} , the...
by runsun
25.12.2015 07:17
Forum: Lexers
Topic: Anyway to catch module with comments in module header?
Replies: 4
Views: 2190

Anyway to catch module with comments in module header?

How can I catch modules having the following 2 structures : module m1(a,b){ ...... } module m2(a,b) // comment { ...... } I setup the block header rule conditions like this: 0 = <symbol> = { 1 = <symbol> = ) 2 Skip all other tokens 3 = <symbol> = ( 4 = <identifier> 5 = <identifier> = module This cat...
by runsun
23.12.2015 21:49
Forum: Lexers
Topic: Anyway to collapse line comments // ?
Replies: 1
Views: 1434

Anyway to collapse line comments // ?

Is it possible to make the following single-line comments collapsible ?

blah blah ...
// comment line 1
// comment line 2
// comment line 3
// comment line 4
blah blah blan ...

to:

blah blah ...
[+] (// comment line1 )
blah blah blan ...
by runsun
22.12.2015 20:50
Forum: Lexers
Topic: Is there any way to inherit a lexer dynamically?
Replies: 1
Views: 1277

Is there any way to inherit a lexer dynamically?

Suppose we have a lexer A, and I want to make a lexer A2 that has 2 parts:

part1 comes from A
part2 newly added in A2

This A2 has a link to A, so when A is modified, the part1 of A2 is automatically updated.

Is it possible to do this ?
by runsun
22.12.2015 17:35
Forum: Lexers
Topic: OpenSCAD lexer
Replies: 6
Views: 4482

OpenSCAD lexer

Alexey wrote:I welcome done lexer as Zip file (make it by ExLexer plugin!!)
Sure. The language I'm working on is http://www.openscad.org, which is very popular in 3D printing.
by runsun
22.12.2015 17:33
Forum: Lexers
Topic: "Not a parent" confusion
Replies: 3
Views: 1654

Alexey wrote:4) Not sure what means "strict parent" and "not a parent" both set.
Usually, mutually conflicting options always use radio box, but not check box. Using check box (that allows users to check both) means checking both has some meaning.