14 Matching Annotations
  1. Jan 2024
    1. By abstracting code away from "Files" and "Lines" we can offer more nuanced views like "Repeated Code Blocks" that could be refactored.
    2. A user wants to comment on a single parameter name in a function. It is highlighted as a unique part of the syntax tree, and they're not happy with the particular name the author of the MR chose. Problem: The user can only comment on the entire line, because "lines" are considered the most fundamental building block in our Diffs UI.
  2. Dec 2023
    1. Abstract syntax tree

      It's an abstract syntax tree because it is a tree representation that doesn't care about the original syntax we used to write the operation. It only cares about the operations we are going to perform.

    2. The four parts of our program
      • Tokenizer takes source code as input and produces tokens;
      • Parser takes tokens as input and produces an AST;
      • Compiler takes an AST as input and produces bytecode;
      • Interpreter takes bytecode as input and produces program results.
  3. Dec 2022
  4. Sep 2022
    1. the AST version of the code is vastly superior IMHO. The knowledge about what constitutes an access modifier is already encoded in the system so it makes more sense to just call the method to test the type of node. The regexp solution may be expedient, but it's not as resilient to change -- if new access modifiers are added in the future it's very likely this code won't be updated, which will be the source of a bug.
  5. Aug 2021
  6. Sep 2020
  7. Jan 2020
    1. Arel’s ComposabilityInternally Arel functions on AST nodes and every time an Arel method is made, the nodes in the AST will be modified accordingly. This is an important nature of how Arel works — composability, so that it’s able to build queries in a flexible way. With this abstract representation, we are able to safely add different filters and operations to the same query and even combine queries regardless of its order. Arel is able to generate the correct SQL query from it.
    1. Arel is a SQL AST (Abstract Syntax Tree-like) manager for Ruby. It allows us to write complex SQL queries in a semantic, reusable fashion. Arel is "framework framework"; it's designed to optimize object and collection modeling over database compatibility. For example, Active Record is built on top of Arel.
  8. Nov 2019