This repository has been archived by the owner on May 13, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
3,044 additions
and
3,044 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,75 @@ | ||
require 'syntax/convertors/abstract' | ||
|
||
module Syntax | ||
module Convertors | ||
class Meta < Abstract | ||
def type= new_type | ||
@tokenizer.type = new_type | ||
end | ||
def type | ||
@tokenizer.type | ||
end | ||
def virtual_root= new_value | ||
@tokenizer.virtual_root = new_value | ||
end | ||
def virtual_root; @tokenizer.virtual_root; end | ||
def follow_includes= new_value | ||
@tokenizer.follow_includes = new_value | ||
end | ||
def swallow= new_value | ||
@tokenizer.swallow = new_value | ||
end | ||
attr_accessor :start_group | ||
def convert text, filename | ||
@tokenizer.filename = filename | ||
@tokenizer.start( text ) do |token| | ||
start_group.call token.group, token | ||
end | ||
@tokenizer.step until @tokenizer.eos? | ||
@tokenizer.finish | ||
end | ||
end | ||
class CodeTree < Abstract | ||
def type= new_type | ||
@tokenizer.type = new_type | ||
end | ||
def type | ||
@tokenizer.type | ||
end | ||
def virtual_root; @tokenizer.virtual_root; end | ||
def virtual_root= new_value | ||
@tokenizer.virtual_root = new_value | ||
end | ||
def follow_includes= new_value | ||
@tokenizer.follow_includes = new_value | ||
end | ||
def swallow= new_value | ||
@tokenizer.swallow = new_value | ||
end | ||
def convert text, filename | ||
@text = text | ||
@filename = filename | ||
VbScriptRaccParser.new.run_parse self, :go | ||
end | ||
def go | ||
@tokenizer.filename = @filename | ||
@tokenizer.start( @text ) do |token| | ||
if $DEBUG | ||
if token.group.is_a? Symbol then | ||
puts "Yielding :#{token.group} for '#{token}'" | ||
else | ||
puts "Yielding characters for '#{token}'" | ||
end | ||
end | ||
yield [token.group, token] unless token.group == :token_sep | ||
end | ||
@tokenizer.step until @tokenizer.eos? | ||
@tokenizer.finish | ||
puts "Yielding final :fake_newline" if $DEBUG | ||
yield [:fake_newline, nil] | ||
puts "Yielding EOF" if $DEBUG | ||
yield [false, false] | ||
end | ||
end | ||
end | ||
end | ||
require 'syntax/convertors/abstract' | ||
|
||
module Syntax | ||
module Convertors | ||
class Meta < Abstract | ||
def type= new_type | ||
@tokenizer.type = new_type | ||
end | ||
def type | ||
@tokenizer.type | ||
end | ||
def virtual_root= new_value | ||
@tokenizer.virtual_root = new_value | ||
end | ||
def virtual_root; @tokenizer.virtual_root; end | ||
def follow_includes= new_value | ||
@tokenizer.follow_includes = new_value | ||
end | ||
def swallow= new_value | ||
@tokenizer.swallow = new_value | ||
end | ||
attr_accessor :start_group | ||
def convert text, filename | ||
@tokenizer.filename = filename | ||
@tokenizer.start( text ) do |token| | ||
start_group.call token.group, token | ||
end | ||
@tokenizer.step until @tokenizer.eos? | ||
@tokenizer.finish | ||
end | ||
end | ||
class CodeTree < Abstract | ||
def type= new_type | ||
@tokenizer.type = new_type | ||
end | ||
def type | ||
@tokenizer.type | ||
end | ||
def virtual_root; @tokenizer.virtual_root; end | ||
def virtual_root= new_value | ||
@tokenizer.virtual_root = new_value | ||
end | ||
def follow_includes= new_value | ||
@tokenizer.follow_includes = new_value | ||
end | ||
def swallow= new_value | ||
@tokenizer.swallow = new_value | ||
end | ||
def convert text, filename | ||
@text = text | ||
@filename = filename | ||
VbScriptRaccParser.new.run_parse self, :go | ||
end | ||
def go | ||
@tokenizer.filename = @filename | ||
@tokenizer.start( @text ) do |token| | ||
if $DEBUG | ||
if token.group.is_a? Symbol then | ||
puts "Yielding :#{token.group} for '#{token}'" | ||
else | ||
puts "Yielding characters for '#{token}'" | ||
end | ||
end | ||
yield [token.group, token] unless token.group == :token_sep | ||
end | ||
@tokenizer.step until @tokenizer.eos? | ||
@tokenizer.finish | ||
puts "Yielding final :fake_newline" if $DEBUG | ||
yield [:fake_newline, nil] | ||
puts "Yielding EOF" if $DEBUG | ||
yield [false, false] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<% | ||
Dim o | ||
Set o = Server.CreateObject("Scripting.Dictionary") | ||
o.Add "foo", "bar" | ||
o.Add "baz", "quux" | ||
Response.Write o("foo") & vbCrLf & vbCrLf | ||
o("foo") = o("baz") | ||
Response.Write o("foo") | ||
%> | ||
<% | ||
Dim o | ||
Set o = Server.CreateObject("Scripting.Dictionary") | ||
o.Add "foo", "bar" | ||
o.Add "baz", "quux" | ||
Response.Write o("foo") & vbCrLf & vbCrLf | ||
o("foo") = o("baz") | ||
Response.Write o("foo") | ||
%> |
Oops, something went wrong.