Skip to content

WIP... it's something i'm building to test my treesitter parser...

Notifications You must be signed in to change notification settings

SeniorMars/typst-raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

raytracer in typst

So far, I've implemented the mandelbrot as a proof of concept.

Mandelbrot

This was made to test my parser. Here is the output:

(source_file
   (set_expression
     (function_call
       (identifier)
       (arguments
         (asssigned_argument
           (identifier)
           (numeric
             (int_literal)
             (unit))))))
   (paragraph_break)
   (let_declaration
     (identifier)
     (parameters)
     (code_block
       (assignment_expression
         (let_declaration
           (identifier))
         (int_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (int_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (int_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (int_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (int_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (int_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (negation
           (float_literal)))
       (assignment_expression
         (let_declaration
           (identifier))
         (float_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (negation
           (float_literal)))
       (assignment_expression
         (let_declaration
           (identifier))
         (float_literal))
       (assignment_expression
         (let_declaration
           (identifier))
         (parenthesized_expression
           (binary_operator
             (parenthesized_expression
               (binary_operator
                 (identifier)
                 (identifier)))
             (identifier))))
       (assignment_expression
         (let_declaration
           (identifier))
         (parenthesized_expression
           (binary_operator
             (parenthesized_expression
               (binary_operator
                 (identifier)
                 (identifier)))
             (identifier))))
       (let_declaration
         (identifier))
       (let_declaration
         (identifier))
       (let_declaration
         (identifier))
       (let_declaration
         (identifier))
       (assignment_expression
         (let_declaration
           (identifier))
         (int_literal))
       (while_expression
         (comparison_expression
           (identifier)
           (identifier))
         (code_block
           (assignment_expression
             (let_declaration
               (identifier))
             (binary_operator
               (binary_operator
                 (identifier)
                 (identifier))
               (identifier)))
           (assignment_expression
             (let_declaration
               (identifier))
             (int_literal))
           (while_expression
             (comparison_expression
               (identifier)
               (identifier))
             (code_block
               (assignment_expression
                 (let_declaration
                   (identifier))
                 (binary_operator
                   (binary_operator
                     (identifier)
                     (identifier))
                   (identifier)))
               (assignment_expression
                 (identifier)
                 (float_literal))
               (assignment_expression
                 (identifier)
                 (float_literal))
               (assignment_expression
                 (identifier)
                 (binary_operator
                   (identifier)
                   (identifier)))
               (assignment_expression
                 (identifier)
                 (binary_operator
                   (identifier)
                   (identifier)))
               (assignment_expression
                 (let_declaration
                   (identifier))
                 (int_literal))
               (while_expression
                 (comparison_expression
                   (boolean_expression
                     (comparison_expression
                       (identifier)
                       (identifier))
                     (parenthesized_expression
                       (binary_operator
                         (identifier)
                         (identifier))))
                   (float_literal))
                 (code_block
                   (assignment_expression
                     (identifier)
                     (binary_operator
                       (binary_operator
                         (binary_operator
                           (float_literal)
                           (identifier))
                         (identifier))
                       (identifier)))
                   (assignment_expression
                     (identifier)
                     (binary_operator
                       (binary_operator
                         (identifier)
                         (identifier))
                       (identifier)))
                   (assignment_expression
                     (identifier)
                     (binary_operator
                       (identifier)
                       (identifier)))
                   (assignment_expression
                     (identifier)
                     (binary_operator
                       (identifier)
                       (identifier)))
                   (assignment_operators
                     (identifier)
                     (int_literal))))
               (assignment_expression
                 (identifier)
                 (binary_operator
                   (method_call
                     (identifier)
                     (identifier)
                     (arguments
                       (argument
                         (identifier))
                       (argument
                         (int_literal))))
                   (int_literal)))
               (assignment_expression
                 (identifier)
                 (binary_operator
                   (method_call
                     (identifier)
                     (identifier)
                     (arguments
                       (argument
                         (identifier))
                       (argument
                         (int_literal))))
                   (int_literal)))
               (assignment_expression
                 (identifier)
                 (binary_operator
                   (method_call
                     (identifier)
                     (identifier)
                     (arguments
                       (argument
                         (identifier))
                       (argument
                         (int_literal))))
                   (int_literal)))
               (content_block
                 (function_call
                   (identifier)
                   (arguments
                     (asssigned_argument
                       (identifier)
                       (function_call
                         (identifier)
                         (arguments
                           (argument
                             (identifier))
                           (argument
                             (identifier))
                           (argument
                             (identifier)))))
                     (asssigned_argument
                       (identifier)
                       (numeric
                         (float_literal)
                         (unit)))
                     (asssigned_argument
                       (identifier)
                       (numeric
                         (float_literal)
                         (unit))))))
               (assignment_operators
                 (identifier)
                 (int_literal))))
           (content_block
             (line_break))
           (assignment_operators
             (identifier)
             (int_literal))))))
   (paragraph_break)
   (function_call
     (identifier)
     (arguments)))

About

WIP... it's something i'm building to test my treesitter parser...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published